Imports
/-
Copyright (c) 2026 Google LLC. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
-/
module
public import Cryptids.ReductionSupport.Riemann95.Auxiliary95RawPhysical@[expose] public sectionnamespace ConjectureMachines.Riemann95Auxiliary.PhysicalRawopen Turing ConjectureMachinesopen ConjectureMachines.Riemann120 ConjectureMachines.Riemann120.Layer2open ConjectureMachines.Semantics.Riemann.Layer1 (encodeRegs)open ReturnRaw (step_mkL_left step_mkL_right step_mk'_left step_mk'_right)Exact padding change; exhausting the root marker creates one extra blank cell.
def exactPad (k : Fin 2) (walked : List (Fin 2)) (fill : Nat) : Nat :=
walked.length + fill + if k.val < walked.count 0 then 0 else 1theorem fenceReturn_exact (k : Fin 2) (walked : List (Fin 2)) (fill : Nat) (hfill : 3 ≤ fill) (hk :
k.val ≤ walked.count 0) (hguard : Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev k.val
walked.reverse).reverse).reverse = true) (bank : List Nat) : ∃ s ≥ 1, Raw.nSteps s
⟨(if k = 0 then 9 else 63), Tape.mk' (ListBlank.append (List.replicate fill 1)
(stackLeftOf true walked)) (ListBlank.append [0, 0]
(ConjectureMachines.Semantics.Riemann.Layer1.regsTape bank))⟩ =
some (rawRoot98 (exactPad k walked fill)
(popBreakRev k.val walked.reverse).reverse bank) := k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkL⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machine⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
let R := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank) k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
have hinit : ∃ t ≥ 1, ns t
⟨(if k = 0 then 9 else 63), Tape.mk'
(ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank))⟩ =
some ⟨(if k.val = 0 then 11 else 2), mkL (stackLeftOf true walked)
(ListBlank.append (List.replicate fill 0) R)⟩ := by
rcases Semantics.Riemann.Layer1.fin2_cases k with rfl | rfl inl walked:List (Fin 2)fill:ℕhfill:3 ≤ fillbank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = true⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }inr walked:List (Fin 2)fill:ℕhfill:3 ≤ fillbank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑1 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑1) walked.reverse).reverse).reverse = true⊢ ∃ t ≥ 1,
ns t
{ state := if 1 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑1 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }
· inl walked:List (Fin 2)fill:ℕhfill:3 ≤ fillbank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = true⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } rcases fill with _ | f inl.zero walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truehfill:3 ≤ 0⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate 0 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate 0 0) R) }inl.succ walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }
· inl.zero walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truehfill:3 ≤ 0⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate 0 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate 0 0) R) } cases hfill All goals completed! 🐙
· inl.succ walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) } have h1 := step_mk'_left (q := 9) (q' := 11) (a := 0) (b := 1) (by walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1⊢ Raw.machine.transition 9 0 = some (1, Dir.left, 11) rfl All goals completed! 🐙)
(ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
((Semantics.Riemann.Layer1.regsTape bank).cons 0) inl.succ walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1h1:step Raw.machine
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }
have h2 := step_mkL_left (q := 11) (q' := 11) (a := 1) (b := 0) (by walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1h1:step Raw.machine
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }⊢ Raw.machine.transition 11 1 = some (0, Dir.left, 11) rfl All goals completed! 🐙)
(ListBlank.append (List.replicate f 1) (stackLeftOf true walked)) R inl.succ walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1h1:step Raw.machine
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }h2:step Raw.machine
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL
(ListBlank.cons 1 (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))) R } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) }⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }
have hscan := scanL (q := 11) (a := 1) (b := 0) (by walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1h1:step Raw.machine
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }h2:step Raw.machine
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL
(ListBlank.cons 1 (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))) R } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) }⊢ Raw.machine.transition 11 1 = some (0, Dir.left, 11) rfl All goals completed! 🐙) f
(stackLeftOf true walked) (R.cons 0) inl.succ walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1h1:step Raw.machine
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }h2:step Raw.machine
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL
(ListBlank.cons 1 (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))) R } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) }hscan:Semantics.Riemann.Layer1.nSteps Raw.machine f
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked)
(ListBlank.append (List.replicate f 0) (ListBlank.cons 0 R)) }⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }
have ht := Semantics.Riemann.Layer1.step_nSteps h1
(Semantics.Riemann.Layer1.step_nSteps h2 hscan) inl.succ walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1h1:step Raw.machine
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }h2:step Raw.machine
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL
(ListBlank.cons 1 (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))) R } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) }hscan:Semantics.Riemann.Layer1.nSteps Raw.machine f
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked)
(ListBlank.append (List.replicate f 0) (ListBlank.cons 0 R)) }ht:Semantics.Riemann.Layer1.nSteps Raw.machine (f + 1 + 1)
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked)
(ListBlank.append (List.replicate f 0) (ListBlank.cons 0 R)) }⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }
rw [Semantics.Riemann.Layer1.append_replicate_cons inl.succ walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1h1:step Raw.machine
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }h2:step Raw.machine
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL
(ListBlank.cons 1 (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))) R } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) }hscan:Semantics.Riemann.Layer1.nSteps Raw.machine f
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked)
(ListBlank.append (List.replicate f 0) (ListBlank.cons 0 R)) }ht:Semantics.Riemann.Layer1.nSteps Raw.machine (f + 1 + 1)
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }] at ht inl.succ walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1h1:step Raw.machine
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }h2:step Raw.machine
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL
(ListBlank.cons 1 (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))) R } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) }hscan:Semantics.Riemann.Layer1.nSteps Raw.machine f
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked)
(ListBlank.append (List.replicate f 0) (ListBlank.cons 0 R)) }ht:Semantics.Riemann.Layer1.nSteps Raw.machine (f + 1 + 1)
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }⊢ ∃ t ≥ 1,
ns t
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }
refine ⟨f + 1 + 1, Nat.le_add_left 1 (f + 1), ?_⟩ inl.succ walked:List (Fin 2)bank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑0 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑0) walked.reverse).reverse).reverse = truef:ℕhfill:3 ≤ f + 1h1:step Raw.machine
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }h2:step Raw.machine
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL
(ListBlank.cons 1 (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))) R } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) }hscan:Semantics.Riemann.Layer1.nSteps Raw.machine f
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate f 1) (stackLeftOf true walked))
(ListBlank.cons 0 R) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked)
(ListBlank.append (List.replicate f 0) (ListBlank.cons 0 R)) }ht:Semantics.Riemann.Layer1.nSteps Raw.machine (f + 1 + 1)
{ state := 9,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 11,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }⊢ ns (f + 1 + 1)
{ state := if 0 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate (f + 1) 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑0 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate (f + 1) 0) R) }
simpa only [Fin.val_zero, ↓reduceIte, List.replicate_succ, ListBlank.append, R] using ht All goals completed! 🐙
· inr walked:List (Fin 2)fill:ℕhfill:3 ≤ fillbank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑1 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑1) walked.reverse).reverse).reverse = true⊢ ∃ t ≥ 1,
ns t
{ state := if 1 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑1 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } have h1 := step_mk'_left (q := 63) (q' := 2) (a := 0) (b := 1) (by walked:List (Fin 2)fill:ℕhfill:3 ≤ fillbank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑1 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑1) walked.reverse).reverse).reverse = true⊢ Raw.machine.transition 63 0 = some (1, Dir.left, 2) rfl All goals completed! 🐙)
(ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
((Semantics.Riemann.Layer1.regsTape bank).cons 0) inr walked:List (Fin 2)fill:ℕhfill:3 ≤ fillbank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑1 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑1) walked.reverse).reverse).reverse = trueh1:step Raw.machine
{ state := 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 2,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }⊢ ∃ t ≥ 1,
ns t
{ state := if 1 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑1 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }
have hscan := scanL (q := 2) (a := 1) (b := 0) (by walked:List (Fin 2)fill:ℕhfill:3 ≤ fillbank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑1 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑1) walked.reverse).reverse).reverse = trueh1:step Raw.machine
{ state := 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 2,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }⊢ Raw.machine.transition 2 1 = some (0, Dir.left, 2) rfl All goals completed! 🐙) fill
(stackLeftOf true walked) R inr walked:List (Fin 2)fill:ℕhfill:3 ≤ fillbank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑1 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑1) walked.reverse).reverse).reverse = trueh1:step Raw.machine
{ state := 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 2,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }hscan:Semantics.Riemann.Layer1.nSteps Raw.machine fill
{ state := 2,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked)) R } =
some
{ state := 2,
tape := Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }⊢ ∃ t ≥ 1,
ns t
{ state := if 1 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑1 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }
refine ⟨fill + 1, Nat.le_add_left 1 fill, ?_⟩ inr walked:List (Fin 2)fill:ℕhfill:3 ≤ fillbank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hk:↑1 ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑1) walked.reverse).reverse).reverse = trueh1:step Raw.machine
{ state := 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.cons 0 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) } =
some
{ state := 2,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.cons 1 (ListBlank.cons 0 (Semantics.Riemann.Layer1.regsTape bank))) }hscan:Semantics.Riemann.Layer1.nSteps Raw.machine fill
{ state := 2,
tape :=
Semantics.Riemann.Layer1.Tape.mkL (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked)) R } =
some
{ state := 2,
tape := Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }⊢ ns (fill + 1)
{ state := if 1 = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑1 = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }
simpa only [Fin.val_one, Nat.one_ne_zero, ↓reduceIte, show (1 : Fin 2) ≠ 0 by decide All goals completed! 🐙,
ListBlank.append, R] using Semantics.Riemann.Layer1.step_nSteps h1 hscan k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
let w := (popBreakRev k.val walked.reverse).reverse k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reverse⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
have hwlen : w.length ≤ walked.length := by
dsimp [w] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reverse⊢ (popBreakRev (↑k) walked.reverse).reverse.length ≤ walked.length
simpa only [List.length_reverse] using popBreakRev_length_le k.val walked.reverse k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.length⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
have hmid : ∃ pad', pad' = exactPad k walked fill ∧ ∃ t ≥ 1, ns t
⟨(if k.val = 0 then 11 else 2), mkL (stackLeftOf true walked)
(ListBlank.append (List.replicate fill 0) R)⟩ =
some ⟨5, mkL (stackLeftOf true w).tail
((ListBlank.append (List.replicate (pad' - w.length) 0) R).cons 1)⟩ := by
clear hinit k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.length⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
by_cases hc : k.val < walked.count 0 pos k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walked⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walked⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
· pos k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walked⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) } have hc' : k.val < walked.reverse.count 0 := by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank) simpa only [List.count_reverse] using hc pos k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverse⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
obtain ⟨t, ht, hscan⟩ := popscan walked.reverse k.val (by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverse⊢ ↑k ≤ 1 clear popscan k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machineR:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverse⊢ ↑k ≤ 1; omega All goals completed! 🐙) hc'
(rootLeftOf true) (ListBlank.append (List.replicate fill 0) R) pos k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverset:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (ListBlank.append walked.reverse (rootLeftOf true)) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (walked.reverse.length - (popBreakRev (↑k) walked.reverse).length) 0)
(ListBlank.append (List.replicate fill 0) R))) }⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
rw [append_replicate_zeros_eq pos k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverset:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (ListBlank.append walked.reverse (rootLeftOf true)) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).tail
(ListBlank.cons 1
(ListBlank.append
(List.replicate (walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill) 0) R)) }⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }] at hscan pos k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverset:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (ListBlank.append walked.reverse (rootLeftOf true)) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).tail
(ListBlank.cons 1
(ListBlank.append
(List.replicate (walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill) 0) R)) }⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
have he : walked.reverse.length - (popBreakRev k.val walked.reverse).length + fill =
walked.length + fill - w.length := by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
have hl : (popBreakRev k.val walked.reverse).length = w.length := by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
simp only [w, List.length_reverse] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverset:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (ListBlank.append walked.reverse (rootLeftOf true)) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).tail
(ListBlank.cons 1
(ListBlank.append
(List.replicate (walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill) 0) R)) }hl:(popBreakRev (↑k) walked.reverse).length = w.length⊢ walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill = walked.length + fill - w.length
rw [List.length_reverse, k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverset:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (ListBlank.append walked.reverse (rootLeftOf true)) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).tail
(ListBlank.cons 1
(ListBlank.append
(List.replicate (walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill) 0) R)) }hl:(popBreakRev (↑k) walked.reverse).length = w.length⊢ walked.length - (popBreakRev (↑k) walked.reverse).length + fill = walked.length + fill - w.length hl k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverset:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (ListBlank.append walked.reverse (rootLeftOf true)) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).tail
(ListBlank.cons 1
(ListBlank.append
(List.replicate (walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill) 0) R)) }hl:(popBreakRev (↑k) walked.reverse).length = w.length⊢ walked.length - w.length + fill = walked.length + fill - w.length] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverset:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (ListBlank.append walked.reverse (rootLeftOf true)) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).tail
(ListBlank.cons 1
(ListBlank.append
(List.replicate (walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill) 0) R)) }hl:(popBreakRev (↑k) walked.reverse).length = w.length⊢ walked.length - w.length + fill = walked.length + fill - w.length
clear popscan hscan k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machineR:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverset:ℕht:t ≥ 1hl:(popBreakRev (↑k) walked.reverse).length = w.length⊢ walked.length - w.length + fill = walked.length + fill - w.length
omega pos k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverset:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (ListBlank.append walked.reverse (rootLeftOf true)) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).tail
(ListBlank.cons 1
(ListBlank.append
(List.replicate (walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill) 0) R)) }he:walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill = walked.length + fill - w.length⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
refine ⟨walked.length + fill, by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:↑k < List.count 0 walkedhc':↑k < List.count 0 walked.reverset:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (ListBlank.append walked.reverse (rootLeftOf true)) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).tail
(ListBlank.cons 1
(ListBlank.append
(List.replicate (walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill) 0) R)) }he:walked.reverse.length - (popBreakRev (↑k) walked.reverse).length + fill = walked.length + fill - w.length⊢ walked.length + fill = exactPad k walked fill simp only [exactPad, hc, ite_true, Nat.add_zero] All goals completed! 🐙,
t, ht, ?_⟩
simpa only [he, stackLeftOf, w, List.reverse_reverse] using hscan All goals completed! 🐙
· neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walked⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) } have heq : walked.reverse.count 0 = k.val := by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
rw [List.count_reverse k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walked⊢ List.count 0 walked = ↑k] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walked⊢ List.count 0 walked = ↑k; clear popscan k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machineR:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walked⊢ List.count 0 walked = ↑k; omega neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑k⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
have hnil : w = [] := by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank) simp only [w, (popBreakRev_of_count_eq k.val walked.reverse heq).1,
List.reverse_nil] neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
have heq' : (walked.reverse ++ [1]).count 0 = k.val := by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
simp only [List.count_append, List.count_cons, List.count_nil,
show ((1 : Fin 2) == 0) = false from rfl, Bool.false_eq_true, ite_false,
Nat.add_zero, heq] neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑k⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
have hp := (popBreakRev_of_count_eq k.val (walked.reverse ++ [1]) heq').2 neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
have hc' : k.val < ((walked.reverse ++ [1]) ++ [0]).count 0 := by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
simp only [List.count_append, heq', List.count_cons_self, List.count_nil] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]⊢ ↑k < ↑k + (0 + 1)
clear popscan k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machineR:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]⊢ ↑k < ↑k + (0 + 1); omega neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
have hstack : stackLeftOf true walked =
ListBlank.append ((walked.reverse ++ [1]) ++ [0]) default := by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
simp only [stackLeftOf, rootLeftOf, ↓reduceIte, ListBlank.append_assoc,
ListBlank.append, Semantics.Riemann.Layer1.default_cons_zero] neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) default⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
obtain ⟨t, ht, hscan⟩ := popscan ((walked.reverse ++ [1]) ++ [0]) k.val
(by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) default⊢ ↑k ≤ 1 clear popscan k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machineR:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) default⊢ ↑k ≤ 1; omega All goals completed! 🐙) hc' default (ListBlank.append (List.replicate fill 0) R) neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape :=
mkL (ListBlank.append (walked.reverse ++ [1] ++ [0]) default) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) (walked.reverse ++ [1] ++ [0])) default).tail
(ListBlank.cons 1
(ListBlank.append
(List.replicate
((walked.reverse ++ [1] ++ [0]).length - (popBreakRev (↑k) (walked.reverse ++ [1] ++ [0])).length) 0)
(ListBlank.append (List.replicate fill 0) R))) }⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
rw [← hstack, neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev (↑k) (walked.reverse ++ [1] ++ [0])) default).tail
(ListBlank.cons 1
(ListBlank.append
(List.replicate
((walked.reverse ++ [1] ++ [0]).length - (popBreakRev (↑k) (walked.reverse ++ [1] ++ [0])).length) 0)
(ListBlank.append (List.replicate fill 0) R))) }⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) } hp, neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append [1] default).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate ((walked.reverse ++ [1] ++ [0]).length - [1].length) 0)
(ListBlank.append (List.replicate fill 0) R))) }⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) } append_replicate_zeros_eq neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append [1] default).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate ((walked.reverse ++ [1] ++ [0]).length - [1].length + fill) 0) R)) }⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }] at hscan neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append [1] default).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate ((walked.reverse ++ [1] ++ [0]).length - [1].length + fill) 0) R)) }⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
have he : ((walked.reverse ++ [1]) ++ [0]).length - ([1] : List (Fin 2)).length + fill =
walked.length + fill + 1 := by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
simp only [List.length_append, List.length_reverse, List.length_cons, List.length_nil] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append [1] default).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate ((walked.reverse ++ [1] ++ [0]).length - [1].length + fill) 0) R)) }⊢ walked.length + (0 + 1) + (0 + 1) - (0 + 1) + fill = walked.length + fill + 1
clear popscan hscan k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machineR:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1⊢ walked.length + (0 + 1) + (0 + 1) - (0 + 1) + fill = walked.length + fill + 1; omega neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append [1] default).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate ((walked.reverse ++ [1] ++ [0]).length - [1].length + fill) 0) R)) }he:(walked.reverse ++ [1] ++ [0]).length - [1].length + fill = walked.length + fill + 1⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
rw [he neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append [1] default).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (walked.length + fill + 1) 0) R)) }he:(walked.reverse ++ [1] ++ [0]).length - [1].length + fill = walked.length + fill + 1⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }] at hscan neg k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append [1] default).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (walked.length + fill + 1) 0) R)) }he:(walked.reverse ++ [1] ++ [0]).length - [1].length + fill = walked.length + fill + 1⊢ ∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }
refine ⟨walked.length + fill + 1, by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhc:¬↑k < List.count 0 walkedheq:List.count 0 walked.reverse = ↑khnil:w = []heq':List.count 0 (walked.reverse ++ [1]) = ↑khp:popBreakRev (↑k) (walked.reverse ++ [1] ++ [0]) = [1]hc':↑k < List.count 0 (walked.reverse ++ [1] ++ [0])hstack:stackLeftOf true walked = ListBlank.append (walked.reverse ++ [1] ++ [0]) defaultt:ℕht:t ≥ 1hscan:ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (ListBlank.append [1] default).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (walked.length + fill + 1) 0) R)) }he:(walked.reverse ++ [1] ++ [0]).length - [1].length + fill = walked.length + fill + 1⊢ walked.length + fill + 1 = exactPad k walked fill simp only [exactPad, hc, ite_false] All goals completed! 🐙,
t, ht, ?_⟩
simpa only [hnil, stackLeftOf, rootLeftOf, ↓reduceIte, List.reverse_nil,
List.length_nil, ListBlank.append, Nat.sub_zero] using hscan k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
have pop_head : ∀ (j : Nat) (rev : List (Fin 2)),
popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xs := by
intro j rev k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }j:ℕrev:List (Fin 2)⊢ popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xs
induction rev generalizing j with
| nil => nil k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }j:ℕ⊢ popBreakRev j [] = [] ∨ ∃ xs, popBreakRev j [] = 1 :: xs exact Or.inl rfl All goals completed! 🐙
| cons b xs ih => cons k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }b:Fin 2xs:List (Fin 2)ih:∀ (j : ℕ), popBreakRev j xs = [] ∨ ∃ xs_1, popBreakRev j xs = 1 :: xs_1j:ℕ⊢ popBreakRev j (b :: xs) = [] ∨ ∃ xs_1, popBreakRev j (b :: xs) = 1 :: xs_1
rcases Semantics.Riemann.Layer1.fin2_cases b with rfl | rfl cons.inl k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }xs:List (Fin 2)ih:∀ (j : ℕ), popBreakRev j xs = [] ∨ ∃ xs_1, popBreakRev j xs = 1 :: xs_1j:ℕ⊢ popBreakRev j (0 :: xs) = [] ∨ ∃ xs_1, popBreakRev j (0 :: xs) = 1 :: xs_1cons.inr k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }xs:List (Fin 2)ih:∀ (j : ℕ), popBreakRev j xs = [] ∨ ∃ xs_1, popBreakRev j xs = 1 :: xs_1j:ℕ⊢ popBreakRev j (1 :: xs) = [] ∨ ∃ xs_1, popBreakRev j (1 :: xs) = 1 :: xs_1
· cons.inl k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }xs:List (Fin 2)ih:∀ (j : ℕ), popBreakRev j xs = [] ∨ ∃ xs_1, popBreakRev j xs = 1 :: xs_1j:ℕ⊢ popBreakRev j (0 :: xs) = [] ∨ ∃ xs_1, popBreakRev j (0 :: xs) = 1 :: xs_1 cases j with
| zero => cons.inl.zero k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }xs:List (Fin 2)ih:∀ (j : ℕ), popBreakRev j xs = [] ∨ ∃ xs_1, popBreakRev j xs = 1 :: xs_1⊢ popBreakRev 0 (0 :: xs) = [] ∨ ∃ xs_1, popBreakRev 0 (0 :: xs) = 1 :: xs_1 exact Or.inr ⟨xs, rfl⟩ All goals completed! 🐙
| succ j => cons.inl.succ k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }xs:List (Fin 2)ih:∀ (j : ℕ), popBreakRev j xs = [] ∨ ∃ xs_1, popBreakRev j xs = 1 :: xs_1j:ℕ⊢ popBreakRev (j + 1) (0 :: xs) = [] ∨ ∃ xs_1, popBreakRev (j + 1) (0 :: xs) = 1 :: xs_1 simpa only [popBreakRev, beq_self_eq_true, ite_true] using ih j All goals completed! 🐙
· cons.inr k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }xs:List (Fin 2)ih:∀ (j : ℕ), popBreakRev j xs = [] ∨ ∃ xs_1, popBreakRev j xs = 1 :: xs_1j:ℕ⊢ popBreakRev j (1 :: xs) = [] ∨ ∃ xs_1, popBreakRev j (1 :: xs) = 1 :: xs_1 cases j with
| zero => cons.inr.zero k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }xs:List (Fin 2)ih:∀ (j : ℕ), popBreakRev j xs = [] ∨ ∃ xs_1, popBreakRev j xs = 1 :: xs_1⊢ popBreakRev 0 (1 :: xs) = [] ∨ ∃ xs_1, popBreakRev 0 (1 :: xs) = 1 :: xs_1 simpa only [popBreakRev, show ((1 : Fin 2) == 0) = false from rfl,
Bool.false_eq_true, ite_false] using ih 0 All goals completed! 🐙
| succ j => cons.inr.succ k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }xs:List (Fin 2)ih:∀ (j : ℕ), popBreakRev j xs = [] ∨ ∃ xs_1, popBreakRev j xs = 1 :: xs_1j:ℕ⊢ popBreakRev (j + 1) (1 :: xs) = [] ∨ ∃ xs_1, popBreakRev (j + 1) (1 :: xs) = 1 :: xs_1 simpa only [popBreakRev, show ((1 : Fin 2) == 0) = false from rfl,
Bool.false_eq_true, ite_false] using ih (j + 1) k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xs⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
have hheadw : (stackLeftOf true w).head = 1 := by
simp only [w, stackLeftOf, List.reverse_reverse] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xs⊢ (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).head = 1
obtain hz | ⟨xs, hx⟩ := pop_head k.val walked.reverse inl k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshz:popBreakRev (↑k) walked.reverse = []⊢ (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).head = 1inr k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xsxs:List (Fin 2)hx:popBreakRev (↑k) walked.reverse = 1 :: xs⊢ (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).head = 1
· inl k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshz:popBreakRev (↑k) walked.reverse = []⊢ (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).head = 1 rw [hz inl k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshz:popBreakRev (↑k) walked.reverse = []⊢ (ListBlank.append [] (rootLeftOf true)).head = 1] inl k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshz:popBreakRev (↑k) walked.reverse = []⊢ (ListBlank.append [] (rootLeftOf true)).head = 1; rfl All goals completed! 🐙
· inr k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xsxs:List (Fin 2)hx:popBreakRev (↑k) walked.reverse = 1 :: xs⊢ (ListBlank.append (popBreakRev (↑k) walked.reverse) (rootLeftOf true)).head = 1 rw [hx inr k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xsxs:List (Fin 2)hx:popBreakRev (↑k) walked.reverse = 1 :: xs⊢ (ListBlank.append (1 :: xs) (rootLeftOf true)).head = 1] inr k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xsxs:List (Fin 2)hx:popBreakRev (↑k) walked.reverse = 1 :: xs⊢ (ListBlank.append (1 :: xs) (rootLeftOf true)).head = 1; simp only [ListBlank.append, ListBlank.head_cons] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
have finish (pad : Nat) (v : List (Fin 2))
(hv : Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = true)
(hhead : (stackLeftOf true v).head = 1) :
∃ t ≥ 1, ns t ⟨5, mkL (stackLeftOf true v).tail
((ListBlank.append (List.replicate (pad - v.length) 0) R).cons 1)⟩ =
some (rawRoot98 pad v bank) := by
let z := pad - v.length k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1pad:ℕv:List (Fin 2)hv:Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = truehhead:(stackLeftOf true v).head = 1z:ℕ := pad - v.length⊢ ∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)
let S := ListBlank.append (List.replicate z 0) R k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1pad:ℕv:List (Fin 2)hv:Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = truehhead:(stackLeftOf true v).head = 1z:ℕ := pad - v.lengthS:ListBlank (Fin 2) := ListBlank.append (List.replicate z 0) R⊢ ∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)
obtain ⟨t, ht, hr⟩ := ReturnRaw.run_return98_after_one v hv hhead S k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1pad:ℕv:List (Fin 2)hv:Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = truehhead:(stackLeftOf true v).head = 1z:ℕ := pad - v.lengthS:ListBlank (Fin 2) := ListBlank.append (List.replicate z 0) Rt:ℕht:1 ≤ thr:Raw.nSteps t { state := 5, tape := Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true v).tail (ListBlank.cons 1 S) } =
some { state := 15, tape := Tape.mk' (rootLeftOf true) (ListBlank.append v S) }⊢ ∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)
have hroot : ⟨15, Tape.mk' (rootLeftOf true) (ListBlank.append v S)⟩ =
rawRoot98 pad v bank := by k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕ⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
simp only [rawRoot98, ListBlank.append_assoc, Semantics.Riemann.Layer1.regsTape, R, z, S] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1pad:ℕv:List (Fin 2)hv:Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = truehhead:(stackLeftOf true v).head = 1z:ℕ := pad - v.lengthS:ListBlank (Fin 2) := ListBlank.append (List.replicate z 0) Rt:ℕht:1 ≤ thr:Raw.nSteps t { state := 5, tape := Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true v).tail (ListBlank.cons 1 S) } =
some { state := 15, tape := Tape.mk' (rootLeftOf true) (ListBlank.append v S) }hroot:{ state := 15, tape := Tape.mk' (rootLeftOf true) (ListBlank.append v S) } = rawRoot98 pad v bank⊢ ∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)
rw [hroot, k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1pad:ℕv:List (Fin 2)hv:Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = truehhead:(stackLeftOf true v).head = 1z:ℕ := pad - v.lengthS:ListBlank (Fin 2) := ListBlank.append (List.replicate z 0) Rt:ℕht:1 ≤ thr:Raw.nSteps t { state := 5, tape := Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true v).tail (ListBlank.cons 1 S) } =
some (rawRoot98 pad v bank)hroot:{ state := 15, tape := Tape.mk' (rootLeftOf true) (ListBlank.append v S) } = rawRoot98 pad v bank⊢ ∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank) nSteps98_eq k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1pad:ℕv:List (Fin 2)hv:Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = truehhead:(stackLeftOf true v).head = 1z:ℕ := pad - v.lengthS:ListBlank (Fin 2) := ListBlank.append (List.replicate z 0) Rt:ℕht:1 ≤ thr:Semantics.Riemann.Layer1.nSteps Raw.machine t
{ state := 5, tape := Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true v).tail (ListBlank.cons 1 S) } =
some (rawRoot98 pad v bank)hroot:{ state := 15, tape := Tape.mk' (rootLeftOf true) (ListBlank.append v S) } = rawRoot98 pad v bank⊢ ∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)] at hr k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1pad:ℕv:List (Fin 2)hv:Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = truehhead:(stackLeftOf true v).head = 1z:ℕ := pad - v.lengthS:ListBlank (Fin 2) := ListBlank.append (List.replicate z 0) Rt:ℕht:1 ≤ thr:Semantics.Riemann.Layer1.nSteps Raw.machine t
{ state := 5, tape := Semantics.Riemann.Layer1.Tape.mkL (stackLeftOf true v).tail (ListBlank.cons 1 S) } =
some (rawRoot98 pad v bank)hroot:{ state := 15, tape := Tape.mk' (rootLeftOf true) (ListBlank.append v S) } = rawRoot98 pad v bank⊢ ∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)
exact ⟨t, ht, hr⟩ k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)hinit:∃ t ≥ 1,
ns t
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1finish:∀ (pad : ℕ) (v : List (Fin 2)),
Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = true →
(stackLeftOf true v).head = 1 →
∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
obtain ⟨t₀, ht₀, h₀⟩ := hinit k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthhmid:∃ pad',
pad' = exactPad k walked fill ∧
∃ t ≥ 1,
ns t
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }pop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1finish:∀ (pad : ℕ) (v : List (Fin 2)),
Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = true →
(stackLeftOf true v).head = 1 →
∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)t₀:ℕht₀:t₀ ≥ 1h₀:ns t₀
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
obtain ⟨pad', hpad', t₁, ht₁, h₁⟩ := hmid k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthpop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1finish:∀ (pad : ℕ) (v : List (Fin 2)),
Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = true →
(stackLeftOf true v).head = 1 →
∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)t₀:ℕht₀:t₀ ≥ 1h₀:ns t₀
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }pad':ℕhpad':pad' = exactPad k walked fillt₁:ℕht₁:t₁ ≥ 1h₁:ns t₁
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
obtain ⟨t₂, ht₂, h₂⟩ := finish pad' w hguard hheadw k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthpop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1finish:∀ (pad : ℕ) (v : List (Fin 2)),
Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = true →
(stackLeftOf true v).head = 1 →
∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)t₀:ℕht₀:t₀ ≥ 1h₀:ns t₀
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }pad':ℕhpad':pad' = exactPad k walked fillt₁:ℕht₁:t₁ ≥ 1h₁:ns t₁
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }t₂:ℕht₂:t₂ ≥ 1h₂:ns t₂
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) } =
some (rawRoot98 pad' w bank)⊢ ∃ s ≥ 1,
Raw.nSteps s
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
refine ⟨t₀ + (t₁ + t₂), Nat.le_trans ht₀ (Nat.le_add_right t₀ (t₁ + t₂)), ?_⟩ k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthpop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1finish:∀ (pad : ℕ) (v : List (Fin 2)),
Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = true →
(stackLeftOf true v).head = 1 →
∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)t₀:ℕht₀:t₀ ≥ 1h₀:ns t₀
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }pad':ℕhpad':pad' = exactPad k walked fillt₁:ℕht₁:t₁ ≥ 1h₁:ns t₁
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }t₂:ℕht₂:t₂ ≥ 1h₂:ns t₂
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) } =
some (rawRoot98 pad' w bank)⊢ Raw.nSteps (t₀ + (t₁ + t₂))
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 (exactPad k walked fill) (popBreakRev (↑k) walked.reverse).reverse bank)
rw [← hpad' k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthpop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1finish:∀ (pad : ℕ) (v : List (Fin 2)),
Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = true →
(stackLeftOf true v).head = 1 →
∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)t₀:ℕht₀:t₀ ≥ 1h₀:ns t₀
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }pad':ℕhpad':pad' = exactPad k walked fillt₁:ℕht₁:t₁ ≥ 1h₁:ns t₁
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }t₂:ℕht₂:t₂ ≥ 1h₂:ns t₂
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) } =
some (rawRoot98 pad' w bank)⊢ Raw.nSteps (t₀ + (t₁ + t₂))
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 pad' (popBreakRev (↑k) walked.reverse).reverse bank)] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthpop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1finish:∀ (pad : ℕ) (v : List (Fin 2)),
Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = true →
(stackLeftOf true v).head = 1 →
∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)t₀:ℕht₀:t₀ ≥ 1h₀:ns t₀
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }pad':ℕhpad':pad' = exactPad k walked fillt₁:ℕht₁:t₁ ≥ 1h₁:ns t₁
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }t₂:ℕht₂:t₂ ≥ 1h₂:ns t₂
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) } =
some (rawRoot98 pad' w bank)⊢ Raw.nSteps (t₀ + (t₁ + t₂))
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 pad' (popBreakRev (↑k) walked.reverse).reverse bank)
rw [nSteps98_eq k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthpop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1finish:∀ (pad : ℕ) (v : List (Fin 2)),
Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = true →
(stackLeftOf true v).head = 1 →
∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)t₀:ℕht₀:t₀ ≥ 1h₀:ns t₀
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }pad':ℕhpad':pad' = exactPad k walked fillt₁:ℕht₁:t₁ ≥ 1h₁:ns t₁
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }t₂:ℕht₂:t₂ ≥ 1h₂:ns t₂
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) } =
some (rawRoot98 pad' w bank)⊢ Semantics.Riemann.Layer1.nSteps Raw.machine (t₀ + (t₁ + t₂))
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 pad' (popBreakRev (↑k) walked.reverse).reverse bank)] k:Fin 2walked:List (Fin 2)fill:ℕhfill:3 ≤ fillhk:↑k ≤ List.count 0 walkedhguard:Riemann104.OnePassGuard.NoThreeZeros (1 :: (popBreakRev (↑k) walked.reverse).reverse).reverse = truebank:List ℕmkL:ListBlank (Fin 2) → ListBlank (Fin 2) → Tape (Fin 2) := Semantics.Riemann.Layer1.Tape.mkLns:ℕ → Cfg 98 2 → Option (Cfg 98 2) := Semantics.Riemann.Layer1.nSteps Raw.machinepopscan:∀ (rev : List (Fin 2)),
∀ j ≤ 1,
j < List.count 0 rev →
∀ (L R : ListBlank (Fin 2)),
∃ s ≥ 1,
ns s { state := if j = 0 then 11 else 2, tape := mkL (ListBlank.append rev L) R } =
some
{ state := 5,
tape :=
mkL (ListBlank.append (popBreakRev j rev) L).tail
(ListBlank.cons 1
(ListBlank.append (List.replicate (rev.length - (popBreakRev j rev).length) 0) R)) }R:ListBlank (Fin 2) := ListBlank.append [1, 0] (Semantics.Riemann.Layer1.regsTape bank)w:List (Fin 2) := (popBreakRev (↑k) walked.reverse).reversehwlen:w.length ≤ walked.lengthpop_head:∀ (j : ℕ) (rev : List (Fin 2)), popBreakRev j rev = [] ∨ ∃ xs, popBreakRev j rev = 1 :: xshheadw:(stackLeftOf true w).head = 1finish:∀ (pad : ℕ) (v : List (Fin 2)),
Riemann104.OnePassGuard.NoThreeZeros (1 :: v).reverse = true →
(stackLeftOf true v).head = 1 →
∃ t ≥ 1,
ns t
{ state := 5,
tape :=
mkL (stackLeftOf true v).tail
(ListBlank.cons 1 (ListBlank.append (List.replicate (pad - v.length) 0) R)) } =
some (rawRoot98 pad v bank)t₀:ℕht₀:t₀ ≥ 1h₀:ns t₀
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) }pad':ℕhpad':pad' = exactPad k walked fillt₁:ℕht₁:t₁ ≥ 1h₁:ns t₁
{ state := if ↑k = 0 then 11 else 2,
tape := mkL (stackLeftOf true walked) (ListBlank.append (List.replicate fill 0) R) } =
some
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) }t₂:ℕht₂:t₂ ≥ 1h₂:ns t₂
{ state := 5,
tape :=
mkL (stackLeftOf true w).tail (ListBlank.cons 1 (ListBlank.append (List.replicate (pad' - w.length) 0) R)) } =
some (rawRoot98 pad' w bank)⊢ Semantics.Riemann.Layer1.nSteps Raw.machine (t₀ + (t₁ + t₂))
{ state := if k = 0 then 9 else 63,
tape :=
Tape.mk' (ListBlank.append (List.replicate fill 1) (stackLeftOf true walked))
(ListBlank.append [0, 0] (Semantics.Riemann.Layer1.regsTape bank)) } =
some (rawRoot98 pad' (popBreakRev (↑k) walked.reverse).reverse bank)
exact Semantics.Riemann.Layer1.nSteps_bind_eq h₀
(Semantics.Riemann.Layer1.nSteps_bind_eq h₁ h₂) All goals completed! 🐙end ConjectureMachines.Riemann95Auxiliary.PhysicalRaw