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.BinaryMachine.Accounting
public import Geb.Prototypes.Computability.BitTree.BinaryMachine.Simulation
public import Geb.Prototypes.Computability.BitTree.BinaryMachine.Macroset_option doc.verso trueOne input bit of the binary-counter recognizer
An input transition is followed by a counter increment exactly at a fork tag or a leaf terminator. The combined segment realizes one accounting update.
Main statements
-
configs_bitimplements one bit without emitting output. -
configs_bit_head_boundsbounds the heads throughout that segment.
Tags
Turing machine, simulation, binary counter
@[expose] public sectionnamespace Geb.BitTree.BinaryMachineopen Turing MultiTapeTMThe complete segment for one bit preserves the representation and bounds its heads.
theorem configs_bit_aux {input : List (Fin 4)}
(cfg : Cfg 3 (Fin 4) (Fin 10) input) (s : Account) (b : Bool) (width : ℕ)
(hv : AccountValid s) (h : Represents width cfg (modeState s.mode) s.forks s.leaves)
(hi : cfg.inputSymbol = some (boolEmb b))
(ha : (accountStep s b).forks.size ≤ width)
(hb : (accountStep s b).leaves.size ≤ width) :
let cost := macroCost s b
let next := accountStep s b
Represents width (machine.configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(machine.configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧
∀ u ≤ cost, HeadBound width (machine.configs cfg u) := input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ width⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = after⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
have hr : Represents width after (postReadState s.mode b) s.forks s.leaves :=
h.consume _ input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leaves⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
have ho : machine.outputString cfg 1 = [] := by
rw [show 1 = 0 + 1 from rfl, input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leaves⊢ machine.outputString cfg (0 + 1) = [] outputString_succ, input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leaves⊢ machine.outputString cfg 0 ++ (outputSymbol (configs cfg 0)).toList = [] configs_zero, input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leaves⊢ machine.outputString cfg 0 ++ (outputSymbol cfg).toList = []
outputSymbol_read cfg s.mode b h.state hi input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leaves⊢ machine.outputString cfg 0 ++ none.toList = []] input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leaves⊢ machine.outputString cfg 0 ++ none.toList = []
rfl input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leavesho:machine.outputString cfg 1 = []⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
have hh : ∀ u ≤ 1, HeadBound width (machine.configs cfg u) := by
intro u hu input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leavesho:machine.outputString cfg 1 = []u:ℕhu:u ≤ 1⊢ HeadBound width (configs cfg u)
have hu' : u = 0 ∨ u = 1 := by input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ width⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u) omega input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leavesho:machine.outputString cfg 1 = []u:ℕhu:u ≤ 1hu':u = 0 ∨ u = 1⊢ HeadBound width (configs cfg u)
rcases hu' with rfl | rfl inl input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leavesho:machine.outputString cfg 1 = []hu:0 ≤ 1⊢ HeadBound width (configs cfg 0)inr input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leavesho:machine.outputString cfg 1 = []hu:1 ≤ 1⊢ HeadBound width (configs cfg 1)
· inl input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leavesho:machine.outputString cfg 1 = []hu:0 ≤ 1⊢ HeadBound width (configs cfg 0) exact h.headBound All goals completed! 🐙
· inr input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leavesho:machine.outputString cfg 1 = []hu:1 ≤ 1⊢ HeadBound width (configs cfg 1) rw [hc inr input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leavesho:machine.outputString cfg 1 = []hu:1 ≤ 1⊢ HeadBound width after] inr input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leavesho:machine.outputString cfg 1 = []hu:1 ≤ 1⊢ HeadBound width after
exact hr.headBound input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState s.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState s.mode b) s.forks s.leavesho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
rcases s with ⟨m, a, c⟩ input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)m:Modea:ℕc:ℕhv:AccountValid { mode := m, forks := a, leaves := c }h:Represents width cfg (modeState { mode := m, forks := a, leaves := c }.mode)
{ mode := m, forks := a, leaves := c }.forks { mode := m, forks := a, leaves := c }.leavesha:(accountStep { mode := m, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := m, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := m, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := m, forks := a, leaves := c }.mode b)
{ mode := m, forks := a, leaves := c }.forks { mode := m, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := m, forks := a, leaves := c } b;
let next := accountStep { mode := m, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
cases m tree input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leavesha:(accountStep { mode := Mode.tree, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode b)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.tree, forks := a, leaves := c } b;
let next := accountStep { mode := Mode.tree, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)string input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leavesha:(accountStep { mode := Mode.string, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode b)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.string, forks := a, leaves := c } b;
let next := accountStep { mode := Mode.string, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)bit input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.bit, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.bit, forks := a, leaves := c }.mode)
{ mode := Mode.bit, forks := a, leaves := c }.forks { mode := Mode.bit, forks := a, leaves := c }.leavesha:(accountStep { mode := Mode.bit, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := Mode.bit, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.bit, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.bit, forks := a, leaves := c }.mode b)
{ mode := Mode.bit, forks := a, leaves := c }.forks { mode := Mode.bit, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.bit, forks := a, leaves := c } b;
let next := accountStep { mode := Mode.bit, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)done input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.done, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.done, forks := a, leaves := c }.mode)
{ mode := Mode.done, forks := a, leaves := c }.forks { mode := Mode.done, forks := a, leaves := c }.leavesha:(accountStep { mode := Mode.done, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := Mode.done, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.done, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.done, forks := a, leaves := c }.mode b)
{ mode := Mode.done, forks := a, leaves := c }.forks { mode := Mode.done, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.done, forks := a, leaves := c } b;
let next := accountStep { mode := Mode.done, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)dead input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leavesha:(accountStep { mode := Mode.dead, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode b)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.dead, forks := a, leaves := c } b;
let next := accountStep { mode := Mode.dead, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u) <;> tree input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leavesha:(accountStep { mode := Mode.tree, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode b)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.tree, forks := a, leaves := c } b;
let next := accountStep { mode := Mode.tree, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)string input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leavesha:(accountStep { mode := Mode.string, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode b)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.string, forks := a, leaves := c } b;
let next := accountStep { mode := Mode.string, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)bit input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.bit, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.bit, forks := a, leaves := c }.mode)
{ mode := Mode.bit, forks := a, leaves := c }.forks { mode := Mode.bit, forks := a, leaves := c }.leavesha:(accountStep { mode := Mode.bit, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := Mode.bit, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.bit, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.bit, forks := a, leaves := c }.mode b)
{ mode := Mode.bit, forks := a, leaves := c }.forks { mode := Mode.bit, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.bit, forks := a, leaves := c } b;
let next := accountStep { mode := Mode.bit, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)done input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.done, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.done, forks := a, leaves := c }.mode)
{ mode := Mode.done, forks := a, leaves := c }.forks { mode := Mode.done, forks := a, leaves := c }.leavesha:(accountStep { mode := Mode.done, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := Mode.done, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.done, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.done, forks := a, leaves := c }.mode b)
{ mode := Mode.done, forks := a, leaves := c }.forks { mode := Mode.done, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.done, forks := a, leaves := c } b;
let next := accountStep { mode := Mode.done, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)dead input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputb:Boolwidth:ℕhi:cfg.inputSymbol = some (boolEmb b)ho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leavesha:(accountStep { mode := Mode.dead, forks := a, leaves := c } b).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } b).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode b)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode b)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.dead, forks := a, leaves := c } b;
let next := accountStep { mode := Mode.dead, forks := a, leaves := c } b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u) cases b dead.false input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode false)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.dead, forks := a, leaves := c } false;
let next := accountStep { mode := Mode.dead, forks := a, leaves := c } false;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)dead.true input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.dead, forks := a, leaves := c } true;
let next := accountStep { mode := Mode.dead, forks := a, leaves := c } true;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
case tree.true => input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.tree, forks := a, leaves := c } true;
let next := accountStep { mode := Mode.tree, forks := a, leaves := c } true;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
have hnext : (a + 1).size ≤ width := by input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ width⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u) simpa [accountStep] using ha input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ width⊢ let cost := macroCost { mode := Mode.tree, forks := a, leaves := c } true;
let next := accountStep { mode := Mode.tree, forks := a, leaves := c } true;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
obtain ⟨hr', hp', ho'⟩ := configs_increment after false width a c hr hnext input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips (if false = true then c else a).bits + 1))
(if (if false = true then a else a + 1) = if false = true then c + 1 else c then stDone else stTree)
(if false = true then a else a + 1) (if false = true then c + 1 else c)hp':(configs after (2 * Counter.flips (if false = true then c else a).bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips (if false = true then c else a).bits + 1) = []⊢ let cost := macroCost { mode := Mode.tree, forks := a, leaves := c } true;
let next := accountStep { mode := Mode.tree, forks := a, leaves := c } true;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
simp only [Bool.false_eq_true, ↓reduceIte] at hr' hp' ho' input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []⊢ let cost := macroCost { mode := Mode.tree, forks := a, leaves := c } true;
let next := accountStep { mode := Mode.tree, forks := a, leaves := c } true;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
have hne : a + 1 ≠ c := by input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ width⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
change c ≤ a ∧ 0 < a ∧ c < a at hv input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < a⊢ a + 1 ≠ c
omega input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ c⊢ let cost := macroCost { mode := Mode.tree, forks := a, leaves := c } true;
let next := accountStep { mode := Mode.tree, forks := a, leaves := c } true;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
have hc' : machine.configs cfg (macroCost ⟨.tree, a, c⟩ true) =
machine.configs after (2 * Counter.flips a.bits + 1) := by input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ width⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
change machine.configs cfg (1 + (2 * Counter.flips a.bits + 1)) = _ input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ c⊢ configs cfg (1 + (2 * Counter.flips a.bits + 1)) = configs after (2 * Counter.flips a.bits + 1)
rw [configs_add, input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ c⊢ configs (configs cfg 1) (2 * Counter.flips a.bits + 1) = configs after (2 * Counter.flips a.bits + 1) hc input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ c⊢ configs after (2 * Counter.flips a.bits + 1) = configs after (2 * Counter.flips a.bits + 1)] input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ let cost := macroCost { mode := Mode.tree, forks := a, leaves := c } true;
let next := accountStep { mode := Mode.tree, forks := a, leaves := c } true;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
refine ⟨?_, ?_, ?_, ?_⟩ refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ Represents width (configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true))
(modeState (accountStep { mode := Mode.tree, forks := a, leaves := c } true).mode)
(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks
(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leavesrefine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ (configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true)).inputPos = moveInputPos cfg.inputPos 1refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ machine.outputString cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) = []refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ ∀ u ≤ macroCost { mode := Mode.tree, forks := a, leaves := c } true, HeadBound width (configs cfg u)
· refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ Represents width (configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true))
(modeState (accountStep { mode := Mode.tree, forks := a, leaves := c } true).mode)
(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks
(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves rw [hc' refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ Represents width (configs after (2 * Counter.flips a.bits + 1))
(modeState (accountStep { mode := Mode.tree, forks := a, leaves := c } true).mode)
(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks
(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves] refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ Represents width (configs after (2 * Counter.flips a.bits + 1))
(modeState (accountStep { mode := Mode.tree, forks := a, leaves := c } true).mode)
(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks
(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves
simpa [accountStep, accountProject, Geb.BitTree.step, modeState, hne] using hr' All goals completed! 🐙
· refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ (configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true)).inputPos = moveInputPos cfg.inputPos 1 rw [hc', refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ (configs after (2 * Counter.flips a.bits + 1)).inputPos = moveInputPos cfg.inputPos 1 hp' refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ after.inputPos = moveInputPos cfg.inputPos 1] refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ after.inputPos = moveInputPos cfg.inputPos 1
rfl All goals completed! 🐙
· refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ machine.outputString cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) = [] change machine.outputString cfg (1 + (2 * Counter.flips a.bits + 1)) = [] refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ machine.outputString cfg (1 + (2 * Counter.flips a.bits + 1)) = []
rw [outputString_add_eq_append, refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ machine.outputString cfg 1 ++ machine.outputString (configs cfg 1) (2 * Counter.flips a.bits + 1) = [] ho, refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ [] ++ machine.outputString (configs cfg 1) (2 * Counter.flips a.bits + 1) = [] hc, refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ [] ++ machine.outputString after (2 * Counter.flips a.bits + 1) = [] ho' refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ [] ++ [] = []] refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ [] ++ [] = []
rfl All goals completed! 🐙
· refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ ∀ u ≤ macroCost { mode := Mode.tree, forks := a, leaves := c } true, HeadBound width (configs cfg u) apply headBound_add cfg width 1 (2 * Counter.flips a.bits + 1) hh refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)⊢ ∀ t ≤ 2 * Counter.flips a.bits + 1, HeadBound width (configs (configs cfg 1) t)
intro u hu refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)u:ℕhu:u ≤ 2 * Counter.flips a.bits + 1⊢ HeadBound width (configs (configs cfg 1) u)
rw [hc refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)u:ℕhu:u ≤ 2 * Counter.flips a.bits + 1⊢ HeadBound width (configs after u)] refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode true)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshnext:(a + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips a.bits + 1)) (if a + 1 = c then stDone else stTree) (a + 1) chp':(configs after (2 * Counter.flips a.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips a.bits + 1) = []hne:a + 1 ≠ chc':configs cfg (macroCost { mode := Mode.tree, forks := a, leaves := c } true) =
configs after (2 * Counter.flips a.bits + 1)u:ℕhu:u ≤ 2 * Counter.flips a.bits + 1⊢ HeadBound width (configs after u)
exact fun i ↦ configs_increment_head_bounds after false width a c hr hnext u hu i All goals completed! 🐙
case string.false => input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaves⊢ let cost := macroCost { mode := Mode.string, forks := a, leaves := c } false;
let next := accountStep { mode := Mode.string, forks := a, leaves := c } false;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
have hnext : (c + 1).size ≤ width := by input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ width⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u) simpa [accountStep] using hb input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ width⊢ let cost := macroCost { mode := Mode.string, forks := a, leaves := c } false;
let next := accountStep { mode := Mode.string, forks := a, leaves := c } false;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
obtain ⟨hr', hp', ho'⟩ := configs_increment after true width a c hr hnext input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips (if true = true then c else a).bits + 1))
(if (if true = true then a else a + 1) = if true = true then c + 1 else c then stDone else stTree)
(if true = true then a else a + 1) (if true = true then c + 1 else c)hp':(configs after (2 * Counter.flips (if true = true then c else a).bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips (if true = true then c else a).bits + 1) = []⊢ let cost := macroCost { mode := Mode.string, forks := a, leaves := c } false;
let next := accountStep { mode := Mode.string, forks := a, leaves := c } false;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
simp only [↓reduceIte] at hr' hp' ho' input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []⊢ let cost := macroCost { mode := Mode.string, forks := a, leaves := c } false;
let next := accountStep { mode := Mode.string, forks := a, leaves := c } false;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
have hmode : modeState (accountStep ⟨.string, a, c⟩ false).mode =
if a = c + 1 then stDone else stTree := by input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ width⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
change c ≤ a ∧ 0 < a ∧ c < a at hv input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < a⊢ modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTree
dsimp [accountStep, accountProject, Geb.BitTree.step, Geb.BitTree.finish] input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < a⊢ modeState (if a - c = 1 then (Mode.done, 0) else (Mode.tree, a - c - 1)).1 = if a = c + 1 then stDone else stTree
by_cases he : a = c + 1 pos input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:a = c + 1⊢ modeState (if a - c = 1 then (Mode.done, 0) else (Mode.tree, a - c - 1)).1 = if a = c + 1 then stDone else stTreeneg input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:¬a = c + 1⊢ modeState (if a - c = 1 then (Mode.done, 0) else (Mode.tree, a - c - 1)).1 = if a = c + 1 then stDone else stTree
· pos input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:a = c + 1⊢ modeState (if a - c = 1 then (Mode.done, 0) else (Mode.tree, a - c - 1)).1 = if a = c + 1 then stDone else stTree have he' : a - c = 1 := by input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ width⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u) omega pos input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:a = c + 1he':a - c = 1⊢ modeState (if a - c = 1 then (Mode.done, 0) else (Mode.tree, a - c - 1)).1 = if a = c + 1 then stDone else stTree
rw [ite_eq_left he', pos input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:a = c + 1he':a - c = 1⊢ modeState (Mode.done, 0).1 = if a = c + 1 then stDone else stTree ite_eq_left he pos input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:a = c + 1he':a - c = 1⊢ modeState (Mode.done, 0).1 = stDone] pos input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:a = c + 1he':a - c = 1⊢ modeState (Mode.done, 0).1 = stDone
rfl All goals completed! 🐙
· neg input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:¬a = c + 1⊢ modeState (if a - c = 1 then (Mode.done, 0) else (Mode.tree, a - c - 1)).1 = if a = c + 1 then stDone else stTree have he' : a - c ≠ 1 := by input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ width⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u) omega neg input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:¬a = c + 1he':a - c ≠ 1⊢ modeState (if a - c = 1 then (Mode.done, 0) else (Mode.tree, a - c - 1)).1 = if a = c + 1 then stDone else stTree
rw [ite_eq_right he', neg input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:¬a = c + 1he':a - c ≠ 1⊢ modeState (Mode.tree, a - c - 1).1 = if a = c + 1 then stDone else stTree ite_eq_right he neg input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:¬a = c + 1he':a - c ≠ 1⊢ modeState (Mode.tree, a - c - 1).1 = stTree] neg input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕh:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hv:c ≤ a ∧ 0 < a ∧ c < ahe:¬a = c + 1he':a - c ≠ 1⊢ modeState (Mode.tree, a - c - 1).1 = stTree
rfl input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTree⊢ let cost := macroCost { mode := Mode.string, forks := a, leaves := c } false;
let next := accountStep { mode := Mode.string, forks := a, leaves := c } false;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
have hc' : machine.configs cfg (macroCost ⟨.string, a, c⟩ false) =
machine.configs after (2 * Counter.flips c.bits + 1) := by input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputs:Accountb:Boolwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leaveshi:cfg.inputSymbol = some (boolEmb b)ha:(accountStep s b).forks.size ≤ widthhb:(accountStep s b).leaves.size ≤ width⊢ let cost := macroCost s b;
let next := accountStep s b;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
change machine.configs cfg (1 + (2 * Counter.flips c.bits + 1)) = _ input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTree⊢ configs cfg (1 + (2 * Counter.flips c.bits + 1)) = configs after (2 * Counter.flips c.bits + 1)
rw [configs_add, input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTree⊢ configs (configs cfg 1) (2 * Counter.flips c.bits + 1) = configs after (2 * Counter.flips c.bits + 1) hc input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTree⊢ configs after (2 * Counter.flips c.bits + 1) = configs after (2 * Counter.flips c.bits + 1)] input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ let cost := macroCost { mode := Mode.string, forks := a, leaves := c } false;
let next := accountStep { mode := Mode.string, forks := a, leaves := c } false;
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(configs cfg cost).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg cost = [] ∧ ∀ u ≤ cost, HeadBound width (configs cfg u)
refine ⟨?_, ?_, ?_, ?_⟩ refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ Represents width (configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false))
(modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode)
(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks
(accountStep { mode := Mode.string, forks := a, leaves := c } false).leavesrefine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ (configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false)).inputPos = moveInputPos cfg.inputPos 1refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ machine.outputString cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) = []refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ ∀ u ≤ macroCost { mode := Mode.string, forks := a, leaves := c } false, HeadBound width (configs cfg u)
· refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ Represents width (configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false))
(modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode)
(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks
(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves rw [hc', refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ Represents width (configs after (2 * Counter.flips c.bits + 1))
(modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode)
(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks
(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves hmode refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree)
(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks
(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves] refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree)
(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks
(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves
exact hr' All goals completed! 🐙
· refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ (configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false)).inputPos = moveInputPos cfg.inputPos 1 rw [hc', refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ (configs after (2 * Counter.flips c.bits + 1)).inputPos = moveInputPos cfg.inputPos 1 hp' refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ after.inputPos = moveInputPos cfg.inputPos 1] refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ after.inputPos = moveInputPos cfg.inputPos 1
rfl All goals completed! 🐙
· refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ machine.outputString cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) = [] change machine.outputString cfg (1 + (2 * Counter.flips c.bits + 1)) = [] refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ machine.outputString cfg (1 + (2 * Counter.flips c.bits + 1)) = []
rw [outputString_add_eq_append, refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ machine.outputString cfg 1 ++ machine.outputString (configs cfg 1) (2 * Counter.flips c.bits + 1) = [] ho, refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ [] ++ machine.outputString (configs cfg 1) (2 * Counter.flips c.bits + 1) = [] hc, refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ [] ++ machine.outputString after (2 * Counter.flips c.bits + 1) = [] ho' refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ [] ++ [] = []] refine_3 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ [] ++ [] = []
rfl All goals completed! 🐙
· refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ ∀ u ≤ macroCost { mode := Mode.string, forks := a, leaves := c } false, HeadBound width (configs cfg u) apply headBound_add cfg width 1 (2 * Counter.flips c.bits + 1) hh refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)⊢ ∀ t ≤ 2 * Counter.flips c.bits + 1, HeadBound width (configs (configs cfg 1) t)
intro u hu refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)u:ℕhu:u ≤ 2 * Counter.flips c.bits + 1⊢ HeadBound width (configs (configs cfg 1) u)
rw [hc refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)u:ℕhu:u ≤ 2 * Counter.flips c.bits + 1⊢ HeadBound width (configs after u)] refine_4 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.string, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.string, forks := a, leaves := c }.mode)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.string, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.string, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.string, forks := a, leaves := c }.mode false)
{ mode := Mode.string, forks := a, leaves := c }.forks { mode := Mode.string, forks := a, leaves := c }.leaveshnext:(c + 1).size ≤ widthhr':Represents width (configs after (2 * Counter.flips c.bits + 1)) (if a = c + 1 then stDone else stTree) a (c + 1)hp':(configs after (2 * Counter.flips c.bits + 1)).inputPos = after.inputPosho':machine.outputString after (2 * Counter.flips c.bits + 1) = []hmode:modeState (accountStep { mode := Mode.string, forks := a, leaves := c } false).mode =
if a = c + 1 then stDone else stTreehc':configs cfg (macroCost { mode := Mode.string, forks := a, leaves := c } false) =
configs after (2 * Counter.flips c.bits + 1)u:ℕhu:u ≤ 2 * Counter.flips c.bits + 1⊢ HeadBound width (configs after u)
exact fun i ↦ configs_increment_head_bounds after true width a c hr hnext u hu i All goals completed! 🐙
all_goals
change Represents width (machine.configs cfg 1) _ a c ∧
(machine.configs cfg 1).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg 1 = [] ∧ ∀ u ≤ 1, HeadBound width (machine.configs cfg u) dead.true input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ Represents width (configs cfg 1) (modeState (accountStep { mode := Mode.dead, forks := a, leaves := c } true).mode) a
c ∧
(configs cfg 1).inputPos = moveInputPos cfg.inputPos 1 ∧
machine.outputString cfg 1 = [] ∧ ∀ u ≤ 1, HeadBound width (configs cfg u)
refine ⟨?_, ?_, ho, hh⟩ dead.true.refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ Represents width (configs cfg 1) (modeState (accountStep { mode := Mode.dead, forks := a, leaves := c } true).mode) a cdead.true.refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ (configs cfg 1).inputPos = moveInputPos cfg.inputPos 1
· dead.true.refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ Represents width (configs cfg 1) (modeState (accountStep { mode := Mode.dead, forks := a, leaves := c } true).mode) a c rw [hc tree.false.refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode false)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaves⊢ Represents width after (modeState (accountStep { mode := Mode.tree, forks := a, leaves := c } false).mode) a c] dead.false.refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode false)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ Represents width after (modeState (accountStep { mode := Mode.dead, forks := a, leaves := c } false).mode) a c dead.true.refine_1 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ Represents width after (modeState (accountStep { mode := Mode.dead, forks := a, leaves := c } true).mode) a c
exact hr All goals completed! 🐙
· dead.true.refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ (configs cfg 1).inputPos = moveInputPos cfg.inputPos 1 rw [hc tree.false.refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.tree, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.tree, forks := a, leaves := c }.mode)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.tree, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.tree, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.tree, forks := a, leaves := c }.mode false)
{ mode := Mode.tree, forks := a, leaves := c }.forks { mode := Mode.tree, forks := a, leaves := c }.leaves⊢ after.inputPos = moveInputPos cfg.inputPos 1] dead.false.refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb false)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } false).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } false).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode false)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode false)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ after.inputPos = moveInputPos cfg.inputPos 1 dead.true.refine_2 input:List (Fin 4)cfg:Cfg 3 (Fin 4) (Fin 10) inputwidth:ℕho:machine.outputString cfg 1 = []hh:∀ u ≤ 1, HeadBound width (configs cfg u)a:ℕc:ℕhv:AccountValid { mode := Mode.dead, forks := a, leaves := c }h:Represents width cfg (modeState { mode := Mode.dead, forks := a, leaves := c }.mode)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaveshi:cfg.inputSymbol = some (boolEmb true)ha:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).forks.size ≤ widthhb:(accountStep { mode := Mode.dead, forks := a, leaves := c } true).leaves.size ≤ widthafter:Cfg 3 (Fin 4) (Fin 10) input := consumeCfg cfg (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)hc:configs cfg 1 = afterhr:Represents width after (postReadState { mode := Mode.dead, forks := a, leaves := c }.mode true)
{ mode := Mode.dead, forks := a, leaves := c }.forks { mode := Mode.dead, forks := a, leaves := c }.leaves⊢ after.inputPos = moveInputPos cfg.inputPos 1
rfl All goals completed! 🐙One input bit realizes the accounting update in its prescribed macro cost.
theorem configs_bit (w : List Bool) (t : ℕ) (ht : t < w.length)
(cfg : Cfg 3 (Fin 4) (Fin 10) (w.map boolEmb)) (hp : cfg.inputPos.val = t + 1)
(s : Account) (width : ℕ) (hv : AccountValid s)
(h : Represents width cfg (modeState s.mode) s.forks s.leaves)
(ha : (accountStep s w[t]).forks.size ≤ width)
(hb : (accountStep s w[t]).leaves.size ≤ width) :
let cost := macroCost s w[t]
let next := accountStep s w[t]
Represents width (machine.configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
(machine.configs cfg cost).inputPos.val = t + 2 ∧ machine.outputString cfg cost = [] := by w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ width⊢ let cost := macroCost s w[t];
let next := accountStep s w[t];
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
↑(configs cfg cost).inputPos = t + 2 ∧ machine.outputString cfg cost = []
obtain ⟨hr, hp', ho, _⟩ := configs_bit_aux cfg s w[t] width hv h
(inputSymbol_at w t ht cfg hp) ha hb w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ widthhr:Represents width (configs cfg (macroCost s w[t])) (modeState (accountStep s w[t]).mode) (accountStep s w[t]).forks
(accountStep s w[t]).leaveshp':(configs cfg (macroCost s w[t])).inputPos = moveInputPos cfg.inputPos 1ho:machine.outputString cfg (macroCost s w[t]) = []right✝:∀ u ≤ macroCost s w[t], HeadBound width (configs cfg u)⊢ let cost := macroCost s w[t];
let next := accountStep s w[t];
Represents width (configs cfg cost) (modeState next.mode) next.forks next.leaves ∧
↑(configs cfg cost).inputPos = t + 2 ∧ machine.outputString cfg cost = []
refine ⟨hr, ?_, ho⟩ w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ widthhr:Represents width (configs cfg (macroCost s w[t])) (modeState (accountStep s w[t]).mode) (accountStep s w[t]).forks
(accountStep s w[t]).leaveshp':(configs cfg (macroCost s w[t])).inputPos = moveInputPos cfg.inputPos 1ho:machine.outputString cfg (macroCost s w[t]) = []right✝:∀ u ≤ macroCost s w[t], HeadBound width (configs cfg u)⊢ ↑(configs cfg (macroCost s w[t])).inputPos = t + 2
rw [hp' w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ widthhr:Represents width (configs cfg (macroCost s w[t])) (modeState (accountStep s w[t]).mode) (accountStep s w[t]).forks
(accountStep s w[t]).leaveshp':(configs cfg (macroCost s w[t])).inputPos = moveInputPos cfg.inputPos 1ho:machine.outputString cfg (macroCost s w[t]) = []right✝:∀ u ≤ macroCost s w[t], HeadBound width (configs cfg u)⊢ ↑(moveInputPos cfg.inputPos 1) = t + 2] w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ widthhr:Represents width (configs cfg (macroCost s w[t])) (modeState (accountStep s w[t]).mode) (accountStep s w[t]).forks
(accountStep s w[t]).leaveshp':(configs cfg (macroCost s w[t])).inputPos = moveInputPos cfg.inputPos 1ho:machine.outputString cfg (macroCost s w[t]) = []right✝:∀ u ≤ macroCost s w[t], HeadBound width (configs cfg u)⊢ ↑(moveInputPos cfg.inputPos 1) = t + 2
have hm := consumeCfg_inputPos cfg (postReadState s.mode w[t]) (by w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ widthhr:Represents width (configs cfg (macroCost s w[t])) (modeState (accountStep s w[t]).mode) (accountStep s w[t]).forks
(accountStep s w[t]).leaveshp':(configs cfg (macroCost s w[t])).inputPos = moveInputPos cfg.inputPos 1ho:machine.outputString cfg (macroCost s w[t]) = []right✝:∀ u ≤ macroCost s w[t], HeadBound width (configs cfg u)⊢ ↑cfg.inputPos < (List.map (⇑boolEmb) w).length + 1
rw [hp, w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ widthhr:Represents width (configs cfg (macroCost s w[t])) (modeState (accountStep s w[t]).mode) (accountStep s w[t]).forks
(accountStep s w[t]).leaveshp':(configs cfg (macroCost s w[t])).inputPos = moveInputPos cfg.inputPos 1ho:machine.outputString cfg (macroCost s w[t]) = []right✝:∀ u ≤ macroCost s w[t], HeadBound width (configs cfg u)⊢ t + 1 < (List.map (⇑boolEmb) w).length + 1 List.length_map w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ widthhr:Represents width (configs cfg (macroCost s w[t])) (modeState (accountStep s w[t]).mode) (accountStep s w[t]).forks
(accountStep s w[t]).leaveshp':(configs cfg (macroCost s w[t])).inputPos = moveInputPos cfg.inputPos 1ho:machine.outputString cfg (macroCost s w[t]) = []right✝:∀ u ≤ macroCost s w[t], HeadBound width (configs cfg u)⊢ t + 1 < w.length + 1] w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ widthhr:Represents width (configs cfg (macroCost s w[t])) (modeState (accountStep s w[t]).mode) (accountStep s w[t]).forks
(accountStep s w[t]).leaveshp':(configs cfg (macroCost s w[t])).inputPos = moveInputPos cfg.inputPos 1ho:machine.outputString cfg (macroCost s w[t]) = []right✝:∀ u ≤ macroCost s w[t], HeadBound width (configs cfg u)⊢ t + 1 < w.length + 1
omega All goals completed! 🐙) w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ widthhr:Represents width (configs cfg (macroCost s w[t])) (modeState (accountStep s w[t]).mode) (accountStep s w[t]).forks
(accountStep s w[t]).leaveshp':(configs cfg (macroCost s w[t])).inputPos = moveInputPos cfg.inputPos 1ho:machine.outputString cfg (macroCost s w[t]) = []right✝:∀ u ≤ macroCost s w[t], HeadBound width (configs cfg u)hm:↑(consumeCfg cfg (postReadState s.mode w[t])).inputPos = ↑cfg.inputPos + 1⊢ ↑(moveInputPos cfg.inputPos 1) = t + 2
change (moveInputPos cfg.inputPos 1).val = _ at hm w:List Boolt:ℕht:t < w.lengthcfg:Cfg 3 (Fin 4) (Fin 10) (List.map (⇑boolEmb) w)hp:↑cfg.inputPos = t + 1s:Accountwidth:ℕhv:AccountValid sh:Represents width cfg (modeState s.mode) s.forks s.leavesha:(accountStep s w[t]).forks.size ≤ widthhb:(accountStep s w[t]).leaves.size ≤ widthhr:Represents width (configs cfg (macroCost s w[t])) (modeState (accountStep s w[t]).mode) (accountStep s w[t]).forks
(accountStep s w[t]).leaveshp':(configs cfg (macroCost s w[t])).inputPos = moveInputPos cfg.inputPos 1ho:machine.outputString cfg (macroCost s w[t]) = []right✝:∀ u ≤ macroCost s w[t], HeadBound width (configs cfg u)hm:↑(moveInputPos cfg.inputPos 1) = ↑cfg.inputPos + 1⊢ ↑(moveInputPos cfg.inputPos 1) = t + 2
omega All goals completed! 🐙Every head remains within the chosen binary width during a complete input-bit segment.
theorem configs_bit_head_bounds (w : List Bool) (t : ℕ) (ht : t < w.length)
(cfg : Cfg 3 (Fin 4) (Fin 10) (w.map boolEmb)) (hp : cfg.inputPos.val = t + 1)
(s : Account) (width : ℕ) (hv : AccountValid s)
(h : Represents width cfg (modeState s.mode) s.forks s.leaves)
(ha : (accountStep s w[t]).forks.size ≤ width)
(hb : (accountStep s w[t]).leaves.size ≤ width) :
∀ u ≤ macroCost s w[t], HeadBound width (machine.configs cfg u) :=
(configs_bit_aux cfg s w[t] width hv h (inputSymbol_at w t ht cfg hp) ha hb).2.2.2end Geb.BitTree.BinaryMachine