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.Parser95
public import Cryptids.ReductionSupport.Riemann95.Physical95
public import Cryptids.ReductionSupport.Riemann95.ControlStep95Terminal execution and arithmetic frames
@[expose] public sectionTerminal configurations
sectionnamespace ConjectureMachines.Riemann95.Dispatchopen Turing ConjectureMachinesopen ConjectureMachines.Riemann95.Parserdef terminal : Schema.ControlWord → Fin 95
| .outside s => outsideTerminal s
| .entry _ => 58
| .local _ s => localTerminal sThe unbounded typed caller frontier follows this exact literal machine.
theorem actual_parse (c : Schema.ControlWord) :
walkInternal 15 (Control.walked c) = some (terminal c) := c:Schema.ControlWord⊢ walkInternal 15 (Control.walked c) = some (terminal c)
cases c with
s:Fin 97⊢ walkInternal 15 (Control.walked (Schema.ControlWord.outside s)) = some (terminal (Schema.ControlWord.outside s)) All goals completed! 🐙
d:ℕ⊢ walkInternal 15 (Control.walked (Schema.ControlWord.entry d)) = some (terminal (Schema.ControlWord.entry d)) All goals completed! 🐙
d:ℕs:Fin 22⊢ walkInternal 15 (Control.walked (Schema.ControlWord.local d s)) = some (terminal (Schema.ControlWord.local d s)) All goals completed! 🐙def nativeCorrect (c : Schema.ControlWord) : Prop :=
match Control.effect c with
| .halt => machine.transition (terminal c) 1 = none
| .inc r => terminal c = Physical.incLeaf r
| .decnz r => terminal c = Physical.decLeaf r
| .jump _ _ => ∃ next : Fin 95,
machine.transition (terminal c) 1 = some (0, .left, next)instance (c : Schema.ControlWord) : Decidable (nativeCorrect c) := c:Schema.ControlWord⊢ Decidable (nativeCorrect c)
c:Schema.ControlWord⊢ Decidable
(match Control.effect c with
| Control.Effect.halt => machine.transition (terminal c) 1 = none
| Control.Effect.inc r => terminal c = Physical.incLeaf r
| Control.Effect.decnz r => terminal c = Physical.decLeaf r
| Control.Effect.jump isContinue k => ∃ next, machine.transition (terminal c) 1 = some (0, Dir.left, next))
c:Schema.ControlWord⊢ Decidable
(match Control.Effect.halt with
| Control.Effect.halt => machine.transition (terminal c) 1 = none
| Control.Effect.inc r => terminal c = Physical.incLeaf r
| Control.Effect.decnz r => terminal c = Physical.decLeaf r
| Control.Effect.jump isContinue k => ∃ next, machine.transition (terminal c) 1 = some (0, Dir.left, next))c:Schema.ControlWordr✝:Fin 5⊢ Decidable
(match Control.Effect.inc r✝ with
| Control.Effect.halt => machine.transition (terminal c) 1 = none
| Control.Effect.inc r => terminal c = Physical.incLeaf r
| Control.Effect.decnz r => terminal c = Physical.decLeaf r
| Control.Effect.jump isContinue k => ∃ next, machine.transition (terminal c) 1 = some (0, Dir.left, next))c:Schema.ControlWordr✝:Fin 5⊢ Decidable
(match Control.Effect.decnz r✝ with
| Control.Effect.halt => machine.transition (terminal c) 1 = none
| Control.Effect.inc r => terminal c = Physical.incLeaf r
| Control.Effect.decnz r => terminal c = Physical.decLeaf r
| Control.Effect.jump isContinue k => ∃ next, machine.transition (terminal c) 1 = some (0, Dir.left, next))c:Schema.ControlWordisContinue✝:Boolk✝:ℕ⊢ Decidable
(match Control.Effect.jump isContinue✝ k✝ with
| Control.Effect.halt => machine.transition (terminal c) 1 = none
| Control.Effect.inc r => terminal c = Physical.incLeaf r
| Control.Effect.decnz r => terminal c = Physical.decLeaf r
| Control.Effect.jump isContinue k => ∃ next, machine.transition (terminal c) 1 = some (0, Dir.left, next)) c:Schema.ControlWord⊢ Decidable
(match Control.Effect.halt with
| Control.Effect.halt => machine.transition (terminal c) 1 = none
| Control.Effect.inc r => terminal c = Physical.incLeaf r
| Control.Effect.decnz r => terminal c = Physical.decLeaf r
| Control.Effect.jump isContinue k => ∃ next, machine.transition (terminal c) 1 = some (0, Dir.left, next))c:Schema.ControlWordr✝:Fin 5⊢ Decidable
(match Control.Effect.inc r✝ with
| Control.Effect.halt => machine.transition (terminal c) 1 = none
| Control.Effect.inc r => terminal c = Physical.incLeaf r
| Control.Effect.decnz r => terminal c = Physical.decLeaf r
| Control.Effect.jump isContinue k => ∃ next, machine.transition (terminal c) 1 = some (0, Dir.left, next))c:Schema.ControlWordr✝:Fin 5⊢ Decidable
(match Control.Effect.decnz r✝ with
| Control.Effect.halt => machine.transition (terminal c) 1 = none
| Control.Effect.inc r => terminal c = Physical.incLeaf r
| Control.Effect.decnz r => terminal c = Physical.decLeaf r
| Control.Effect.jump isContinue k => ∃ next, machine.transition (terminal c) 1 = some (0, Dir.left, next))c:Schema.ControlWordisContinue✝:Boolk✝:ℕ⊢ Decidable
(match Control.Effect.jump isContinue✝ k✝ with
| Control.Effect.halt => machine.transition (terminal c) 1 = none
| Control.Effect.inc r => terminal c = Physical.incLeaf r
| Control.Effect.decnz r => terminal c = Physical.decLeaf r
| Control.Effect.jump isContinue k => ∃ next, machine.transition (terminal c) 1 = some (0, Dir.left, next)) All goals completed! 🐙theorem outside_nativeCorrect : ∀ s : Fin 97, nativeCorrect (.outside s) := ⊢ ∀ (s : Fin 97), nativeCorrect (Schema.ControlWord.outside s)
All goals completed! 🐙theorem local_nativeCorrect : ∀ s : Fin 22, nativeCorrect (.local 0 s) := ⊢ ∀ (s : Fin 22), nativeCorrect (Schema.ControlWord.local 0 s)
All goals completed! 🐙Native arithmetic indices are literal Fin5 leaves; halt and jump use the actual ONE cell.
theorem nativeCorrect_all (c : Schema.ControlWord) : nativeCorrect c := c:Schema.ControlWord⊢ nativeCorrect c
cases c with
s:Fin 97⊢ nativeCorrect (Schema.ControlWord.outside s) All goals completed! 🐙
d:ℕ⊢ nativeCorrect (Schema.ControlWord.entry d) All goals completed! 🐙
d:ℕs:Fin 22⊢ nativeCorrect (Schema.ControlWord.local d s) All goals completed! 🐙end ConjectureMachines.Riemann95.DispatchendArithmetic frames
sectionnamespace ConjectureMachines.Riemann95.Dispatchopen Turing ConjectureMachinestheorem entry_append_zero (d : Nat) : Schema.entry d ++ [0] = Schema.callerPrefix d := d:ℕ⊢ Schema.entry d ++ [0] = Schema.callerPrefix d
d:ℕhp:∃ p, Schema.callerPrefix d = p ++ [0]⊢ Schema.entry d ++ [0] = Schema.callerPrefix d
obtain ⟨p, hp⟩ := hp d:ℕp:List (Fin 2)hp:Schema.callerPrefix d = p ++ [0]⊢ Schema.entry d ++ [0] = Schema.callerPrefix d
simp only [Schema.entry, hp, List.dropLast_concat] All goals completed! 🐙def arithmeticPrefix (c : Schema.ControlWord) : Prop :=
match Control.effect c with
| .inc _ | .decnz _ => Control.walked c =
Schema.word c ++ List.replicate ((Control.walked c).length - (Schema.word c).length) 0
| _ => Trueinstance (c : Schema.ControlWord) : Decidable (arithmeticPrefix c) := by c:Schema.ControlWord⊢ Decidable (arithmeticPrefix c)
unfold arithmeticPrefix c:Schema.ControlWord⊢ Decidable
(match Control.effect c with
| Control.Effect.inc r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| Control.Effect.decnz r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| x => True)
cases Control.effect c halt c:Schema.ControlWord⊢ Decidable
(match Control.Effect.halt with
| Control.Effect.inc r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| Control.Effect.decnz r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| x => True)inc c:Schema.ControlWordr✝:Fin 5⊢ Decidable
(match Control.Effect.inc r✝ with
| Control.Effect.inc r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| Control.Effect.decnz r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| x => True)decnz c:Schema.ControlWordr✝:Fin 5⊢ Decidable
(match Control.Effect.decnz r✝ with
| Control.Effect.inc r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| Control.Effect.decnz r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| x => True)jump c:Schema.ControlWordisContinue✝:Boolk✝:ℕ⊢ Decidable
(match Control.Effect.jump isContinue✝ k✝ with
| Control.Effect.inc r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| Control.Effect.decnz r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| x => True) <;> halt c:Schema.ControlWord⊢ Decidable
(match Control.Effect.halt with
| Control.Effect.inc r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| Control.Effect.decnz r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| x => True)inc c:Schema.ControlWordr✝:Fin 5⊢ Decidable
(match Control.Effect.inc r✝ with
| Control.Effect.inc r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| Control.Effect.decnz r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| x => True)decnz c:Schema.ControlWordr✝:Fin 5⊢ Decidable
(match Control.Effect.decnz r✝ with
| Control.Effect.inc r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| Control.Effect.decnz r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| x => True)jump c:Schema.ControlWordisContinue✝:Boolk✝:ℕ⊢ Decidable
(match Control.Effect.jump isContinue✝ k✝ with
| Control.Effect.inc r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| Control.Effect.decnz r =>
Control.walked c = Schema.word c ++ List.replicate (List.length (Control.walked c) - List.length (Schema.word c)) 0
| x => True) infer_instance All goals completed! 🐙theorem outside_arithmeticPrefix : ∀ s : Fin 97, arithmeticPrefix (.outside s) := by ⊢ ∀ (s : Fin 97), arithmeticPrefix (Schema.ControlWord.outside s)
decide +kernel All goals completed! 🐙theorem entry_arithmeticPrefix (d : Nat) : arithmeticPrefix (.entry d) := by d:ℕ⊢ arithmeticPrefix (Schema.ControlWord.entry d)
have hlen : (Control.walked (.entry d)).length - (Schema.word (.entry d)).length = 2 := by
simp only [Control.walked, Schema.word, List.length_append, Schema.callerPrefix_length,
Schema.entry_length, List.length_cons, List.length_nil] d:ℕ⊢ 5 * d + 6 + (0 + 1) - (5 * d + 5) = 2
omega d:ℕhlen:List.length (Control.walked (Schema.ControlWord.entry d)) - List.length (Schema.word (Schema.ControlWord.entry d)) = 2⊢ arithmeticPrefix (Schema.ControlWord.entry d)
change Schema.callerPrefix d ++ [0] = Schema.entry d ++
List.replicate ((Control.walked (.entry d)).length - (Schema.word (.entry d)).length) 0 d:ℕhlen:List.length (Control.walked (Schema.ControlWord.entry d)) - List.length (Schema.word (Schema.ControlWord.entry d)) = 2⊢ Schema.callerPrefix d ++ [0] =
Schema.entry d ++
List.replicate
(List.length (Control.walked (Schema.ControlWord.entry d)) -
List.length (Schema.word (Schema.ControlWord.entry d)))
0
rw [hlen, d:ℕhlen:List.length (Control.walked (Schema.ControlWord.entry d)) - List.length (Schema.word (Schema.ControlWord.entry d)) = 2⊢ Schema.callerPrefix d ++ [0] = Schema.entry d ++ List.replicate 2 0 ← entry_append_zero d:ℕhlen:List.length (Control.walked (Schema.ControlWord.entry d)) - List.length (Schema.word (Schema.ControlWord.entry d)) = 2⊢ Schema.entry d ++ [0] ++ [0] = Schema.entry d ++ List.replicate 2 0] d:ℕhlen:List.length (Control.walked (Schema.ControlWord.entry d)) - List.length (Schema.word (Schema.ControlWord.entry d)) = 2⊢ Schema.entry d ++ [0] ++ [0] = Schema.entry d ++ List.replicate 2 0
simp only [List.append_assoc] d:ℕhlen:List.length (Control.walked (Schema.ControlWord.entry d)) - List.length (Schema.word (Schema.ControlWord.entry d)) = 2⊢ Schema.entry d ++ ([0] ++ [0]) = Schema.entry d ++ List.replicate 2 0
rfl All goals completed! 🐙theorem local_arithmeticPrefix (d : Nat) (s : Fin 22) : arithmeticPrefix (.local d s) := by d:ℕs:Fin 22⊢ arithmeticPrefix (Schema.ControlWord.local d s)
rcases s with ⟨sv, hsv⟩ d:ℕsv:ℕhsv:sv < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨sv, hsv⟩)
interval_cases sv «0» d:ℕsv:ℕhsv:0 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨0, hsv⟩)«1» d:ℕsv:ℕhsv:1 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨1, hsv⟩)«2» d:ℕsv:ℕhsv:2 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨2, hsv⟩)«3» d:ℕsv:ℕhsv:3 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨3, hsv⟩)«4» d:ℕsv:ℕhsv:4 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨4, hsv⟩)«5» d:ℕsv:ℕhsv:5 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨5, hsv⟩)«6» d:ℕsv:ℕhsv:6 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨6, hsv⟩)«7» d:ℕsv:ℕhsv:7 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨7, hsv⟩)«8» d:ℕsv:ℕhsv:8 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨8, hsv⟩)«9» d:ℕsv:ℕhsv:9 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨9, hsv⟩)«10» d:ℕsv:ℕhsv:10 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨10, hsv⟩)«11» d:ℕsv:ℕhsv:11 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨11, hsv⟩)«12» d:ℕsv:ℕhsv:12 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨12, hsv⟩)«13» d:ℕsv:ℕhsv:13 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨13, hsv⟩)«14» d:ℕsv:ℕhsv:14 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨14, hsv⟩)«15» d:ℕsv:ℕhsv:15 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨15, hsv⟩)«16» d:ℕsv:ℕhsv:16 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨16, hsv⟩)«17» d:ℕsv:ℕhsv:17 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨17, hsv⟩)«18» d:ℕsv:ℕhsv:18 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨18, hsv⟩)«19» d:ℕsv:ℕhsv:19 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨19, hsv⟩)«20» d:ℕsv:ℕhsv:20 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨20, hsv⟩)«21» d:ℕsv:ℕhsv:21 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨21, hsv⟩) <;> «0» d:ℕsv:ℕhsv:0 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨0, hsv⟩)«1» d:ℕsv:ℕhsv:1 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨1, hsv⟩)«2» d:ℕsv:ℕhsv:2 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨2, hsv⟩)«3» d:ℕsv:ℕhsv:3 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨3, hsv⟩)«4» d:ℕsv:ℕhsv:4 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨4, hsv⟩)«5» d:ℕsv:ℕhsv:5 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨5, hsv⟩)«6» d:ℕsv:ℕhsv:6 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨6, hsv⟩)«7» d:ℕsv:ℕhsv:7 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨7, hsv⟩)«8» d:ℕsv:ℕhsv:8 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨8, hsv⟩)«9» d:ℕsv:ℕhsv:9 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨9, hsv⟩)«10» d:ℕsv:ℕhsv:10 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨10, hsv⟩)«11» d:ℕsv:ℕhsv:11 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨11, hsv⟩)«12» d:ℕsv:ℕhsv:12 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨12, hsv⟩)«13» d:ℕsv:ℕhsv:13 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨13, hsv⟩)«14» d:ℕsv:ℕhsv:14 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨14, hsv⟩)«15» d:ℕsv:ℕhsv:15 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨15, hsv⟩)«16» d:ℕsv:ℕhsv:16 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨16, hsv⟩)«17» d:ℕsv:ℕhsv:17 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨17, hsv⟩)«18» d:ℕsv:ℕhsv:18 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨18, hsv⟩)«19» d:ℕsv:ℕhsv:19 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨19, hsv⟩)«20» d:ℕsv:ℕhsv:20 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨20, hsv⟩)«21» d:ℕsv:ℕhsv:21 < 22⊢ arithmeticPrefix (Schema.ControlWord.local d ⟨21, hsv⟩)
simp [arithmeticPrefix, Control.effect, Control.localEffects, Control.walked,
Schema.word, Schema.localWalk, Schema.localWalkSuffix, Schema.localWalkSuffixes,
Schema.suffix, Schema.suffixes, List.length_append, Nat.add_sub_add_left,
List.append_assoc] All goals completed! 🐙The arithmetic dispatcher consumes exactly the word followed by blank cells.
theorem arithmeticPrefix_all (c : Schema.ControlWord) : arithmeticPrefix c := by c:Schema.ControlWord⊢ arithmeticPrefix c
cases c with
| outside s => outside s:Fin 97⊢ arithmeticPrefix (Schema.ControlWord.outside s) exact outside_arithmeticPrefix s All goals completed! 🐙
| entry d => entry d:ℕ⊢ arithmeticPrefix (Schema.ControlWord.entry d) exact entry_arithmeticPrefix d All goals completed! 🐙
| local d s => local d:ℕs:Fin 22⊢ arithmeticPrefix (Schema.ControlWord.local d s) exact local_arithmeticPrefix d s All goals completed! 🐙end ConjectureMachines.Riemann95.DispatchendHalting transition
sectionnamespace ConjectureMachines.Riemann95open Turing ConjectureMachinesThe final typed HALT word reaches the actual unique NONE cell before touching the bank.
theorem physical_halt_word (P : Nat) (bank : List Nat) :
∃ s, ∃ c : Cfg 95 2,
nSteps s (Physical.rootCfg P (Schema.word (.outside Control.finalHaltId)) bank) =
some c ∧ step machine c = none := by P:ℕbank:List ℕ⊢ ∃ s c,
nSteps s (Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank) = some c ∧
step machine c = none
let bits : List (Fin 2) := [1,1,1,1,1,1] P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]⊢ ∃ s c,
nSteps s (Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank) = some c ∧
step machine c = none
let L := Riemann120.rootLeftOf true P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf true⊢ ∃ s c,
nSteps s (Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank) = some c ∧
step machine c = none
let R := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1,0] ++
Semantics.Riemann.Layer1.encodeRegs bank) P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)⊢ ∃ s c,
nSteps s (Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank) = some c ∧
step machine c = none
have hword : Schema.word (.outside Control.finalHaltId) = bits ++ [1] := rfl P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]⊢ ∃ s c,
nSteps s (Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank) = some c ∧
step machine c = none
have hwalk : ConjectureMachines.Riemann95.Parser.walkInternal 15 bits = some 61 := by
rfl P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61⊢ ∃ s c,
nSteps s (Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank) = some c ∧
step machine c = none
have hroot : Physical.rootCfg P (Schema.word (.outside Control.finalHaltId)) bank =
⟨15, Tape.mk' L (ListBlank.append bits R)⟩ := by
simp only [Physical.rootCfg, hword, List.length_cons,
List.length_nil, bits, L, R, ListBlank.append_mk, List.cons_append, List.nil_append] P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61⊢ { state := 15,
tape :=
Tape.mk' (ListBlank.cons 1 default)
(ListBlank.mk
(1 ::
1 ::
1 ::
1 ::
1 ::
1 ::
1 ::
(List.replicate (P - (0 + 1 + 1 + 1 + 1 + 1 + 1 + 1)) 0 ++ [1, 0] ++
Semantics.Riemann.Layer1.encodeRegs bank))) } =
{ state := 15,
tape :=
Tape.mk' (Riemann120.rootLeftOf true)
(ListBlank.mk
(1 ::
1 ::
1 ::
1 :: 1 :: 1 :: 1 :: (List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank))) }
rfl P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61hroot:Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank =
{ state := 15, tape := Tape.mk' L (ListBlank.append bits R) }⊢ ∃ s c,
nSteps s (Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank) = some c ∧
step machine c = none
refine ⟨6, ⟨61, Tape.mk' (ListBlank.append bits.reverse L) R⟩, ?_, ?_⟩ refine_1 P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61hroot:Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank =
{ state := 15, tape := Tape.mk' L (ListBlank.append bits R) }⊢ nSteps 6 (Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank) =
some { state := 61, tape := Tape.mk' (ListBlank.append bits.reverse L) R }refine_2 P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61hroot:Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank =
{ state := 15, tape := Tape.mk' L (ListBlank.append bits R) }⊢ step machine { state := 61, tape := Tape.mk' (ListBlank.append bits.reverse L) R } = none
· refine_1 P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61hroot:Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank =
{ state := 15, tape := Tape.mk' L (ListBlank.append bits R) }⊢ nSteps 6 (Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank) =
some { state := 61, tape := Tape.mk' (ListBlank.append bits.reverse L) R } rw [hroot refine_1 P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61hroot:Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank =
{ state := 15, tape := Tape.mk' L (ListBlank.append bits R) }⊢ nSteps 6 { state := 15, tape := Tape.mk' L (ListBlank.append bits R) } =
some { state := 61, tape := Tape.mk' (ListBlank.append bits.reverse L) R }] refine_1 P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61hroot:Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank =
{ state := 15, tape := Tape.mk' L (ListBlank.append bits R) }⊢ nSteps 6 { state := 15, tape := Tape.mk' L (ListBlank.append bits R) } =
some { state := 61, tape := Tape.mk' (ListBlank.append bits.reverse L) R }
exact ConjectureMachines.Riemann95.Parser.walkInternal_nSteps bits 15 61 L R hwalk All goals completed! 🐙
· refine_2 P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61hroot:Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank =
{ state := 15, tape := Tape.mk' L (ListBlank.append bits R) }⊢ step machine { state := 61, tape := Tape.mk' (ListBlank.append bits.reverse L) R } = none have hR : R.head = 1 := by P:ℕbank:List ℕ⊢ ∃ s c,
nSteps s (Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank) = some c ∧
step machine c = none
simp only [R, List.cons_append, List.nil_append, ← ListBlank.cons_mk, ListBlank.head_cons] refine_2 P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61hroot:Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank =
{ state := 15, tape := Tape.mk' L (ListBlank.append bits R) }hR:R.head = 1⊢ step machine { state := 61, tape := Tape.mk' (ListBlank.append bits.reverse L) R } = none
simp only [step, Tape.mk'_head, hR] refine_2 P:ℕbank:List ℕbits:List (Fin 2) := [1, 1, 1, 1, 1, 1]L:ListBlank (Fin 2) := Riemann120.rootLeftOf trueR:ListBlank (Fin 2) := ListBlank.mk ([1] ++ List.replicate (P - 7) 0 ++ [1, 0] ++ Semantics.Riemann.Layer1.encodeRegs bank)hword:Schema.word (Schema.ControlWord.outside Control.finalHaltId) = bits ++ [1]hwalk:Parser.walkInternal 15 bits = some 61hroot:Physical.rootCfg P (Schema.word (Schema.ControlWord.outside Control.finalHaltId)) bank =
{ state := 15, tape := Tape.mk' L (ListBlank.append bits R) }hR:R.head = 1⊢ Option.map
(fun x ↦
{ state := x.2.2, tape := Tape.move x.2.1 (Tape.write x.1 (Tape.mk' (ListBlank.append bits.reverse L) R)) })
(machine.transition 61 1) =
none
rfl All goals completed! 🐙end ConjectureMachines.Riemann95end