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.SwapBank95 public import Cryptids.ReductionSupport.Riemann95.Initializer95
@[expose] public sectionnamespace ConjectureMachines.Riemann95.TypedPrewidthopen Schemaopen ConjectureMachines.Riemann120.Layer2 (RhRegCfg)attribute [local irreducible] ReferenceProgram.word ReferenceProgram.decoded ReferenceProgram.instruction ReferenceLogical.word ReferenceLogical.decoded ReferenceLogical.instruction ReferencePreStep95def ctl89 (s : Fin 89) : Fin 97 := s.castLE (s:Fin 89⊢ 89 ≤ 97 All goals completed! 🐙)def ref89 (s : Fin 89) : Fin 121 := s.castLE (s:Fin 89⊢ 89 ≤ 121 All goals completed! 🐙)def ctl85 (s : Fin 85) : Fin 97 := ⟨s.val+3,s:Fin 85⊢ ↑s + 3 < 97 All goals completed! 🐙⟩def ref85 (s : Fin 85) : Fin 121 := ⟨s.val+3,s:Fin 85⊢ ↑s + 3 < 121 All goals completed! 🐙⟩theorem words_match : ∀ s : Fin 89, outsideWord (ctl89 s) = ReferenceProgram.word (ref89 s) := ⊢ ∀ (s : Fin 89), outsideWord (ctl89 s) = ReferenceProgram.word (ref89 s) All goals completed! 🐙theorem instructions_match : ∀ s : Fin 85, Control.rawInstr (.outside (ctl85 s)) = swapInstr (ReferenceProgram.decoded (ref85 s)) := ⊢ ∀ (s : Fin 85), Control.rawInstr (ControlWord.outside (ctl85 s)) = swapInstr (ReferenceProgram.decoded (ref85 s)) All goals completed! 🐙theorem word88_unique : ∀ s : Fin 89, ReferenceProgram.word (ref89 s) = ReferenceProgram.word 88 → s.val = 88 := ⊢ ∀ (s : Fin 89), ReferenceProgram.word (ref89 s) = ReferenceProgram.word 88 → ↑s = 88 All goals completed! 🐙theorem word88_match : word (.outside 88) = ReferenceProgram.word 88 := ⊢ word (ControlWord.outside 88) = ReferenceProgram.word 88 All goals completed! 🐙theorem word3_match : word (.outside 3) = ReferenceProgram.word 3 := ⊢ word (ControlWord.outside 3) = ReferenceProgram.word 3 All goals completed! 🐙def InPrewidth : ControlWord → Prop | .outside i => 3 ≤ i.val ∧ i.val < 89 | _ => Falseinstance (c : ControlWord) : Decidable (InPrewidth c) := c:ControlWord⊢ Decidable (InPrewidth c) id✝:Fin 97⊢ Decidable (InPrewidth (ControlWord.outside id✝))depth✝:ℕ⊢ Decidable (InPrewidth (ControlWord.entry depth✝))depth✝:ℕid✝:Fin 22⊢ Decidable (InPrewidth (ControlWord.local depth✝ id✝)) id✝:Fin 97⊢ Decidable (InPrewidth (ControlWord.outside id✝))depth✝:ℕ⊢ Decidable (InPrewidth (ControlWord.entry depth✝))depth✝:ℕid✝:Fin 22⊢ Decidable (InPrewidth (ControlWord.local depth✝ id✝)) depth✝:ℕid✝:Fin 22⊢ Decidable False id✝:Fin 97⊢ Decidable (3 ≤ ↑id✝ ∧ ↑id✝ < 89)depth✝:ℕ⊢ Decidable Falsedepth✝:ℕid✝:Fin 22⊢ Decidable False All goals completed! 🐙def nextControls : Control.Instr → List ControlWord | .halt => [] | .jump n | .inc _ n => [n] | .decnz _ p z => [p,z]theorem targets_match : ∀ s : Fin 85, (nextControls (Control.instruction (.outside (ctl85 s)))).all (fun c => decide (InPrewidth c)) = true := ⊢ ∀ (s : Fin 85), ((nextControls (Control.instruction (ControlWord.outside (ctl85 s)))).all fun c ↦ decide (InPrewidth c)) = true All goals completed! 🐙def encodeCfg (c : Control.Cfg) : RhRegCfg := ⟨word c.control,swapBank c.regs⟩def preStep (c : Control.Cfg) : Option Control.Cfg := if c.control = .outside 88 then none else Control.step ctheorem word_range (i : Fin 97) (hi : i.val < 89) : word (.outside i) = ReferenceProgram.word (ref89 ⟨i.val,hi⟩) := i:Fin 97hi:↑i < 89⊢ word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, hi⟩) i:Fin 97hi:↑i < 89h:outsideWord (ctl89 ⟨↑i, hi⟩) = ReferenceProgram.word (ref89 ⟨↑i, hi⟩)⊢ word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, hi⟩) i:Fin 97hi:↑i < 89h:outsideWord (ctl89 ⟨↑i, hi⟩) = ReferenceProgram.word (ref89 ⟨↑i, hi⟩)he:ctl89 ⟨↑i, hi⟩ = i⊢ word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, hi⟩) All goals completed! 🐙theorem instruction_range (i : Fin 97) (hlo : 3 ≤ i.val) (hi : i.val < 88) : Control.rawInstr (.outside i) = swapInstr (ReferenceProgram.decoded (ref85 ⟨i.val-3,i:Fin 97hlo:3 ≤ ↑ihi:↑i < 88⊢ ↑i - 3 < 85 All goals completed! 🐙⟩)) := i:Fin 97hlo:3 ≤ ↑ihi:↑i < 88⊢ Control.rawInstr (ControlWord.outside i) = swapInstr (ReferenceProgram.decoded (ref85 ⟨↑i - 3, ⋯⟩)) i:Fin 97hlo:3 ≤ ↑ihi:↑i < 88j:Fin 85 := ⟨↑i - 3, ⋯⟩⊢ Control.rawInstr (ControlWord.outside i) = swapInstr (ReferenceProgram.decoded (ref85 ⟨↑i - 3, ⋯⟩)) i:Fin 97hlo:3 ≤ ↑ihi:↑i < 88j:Fin 85 := ⟨↑i - 3, ⋯⟩he:ctl85 j = i⊢ Control.rawInstr (ControlWord.outside i) = swapInstr (ReferenceProgram.decoded (ref85 ⟨↑i - 3, ⋯⟩)) All goals completed! 🐙theorem step_control_mem (c next : Control.Cfg) (h : Control.step c = some next) : next.control ∈ nextControls (Control.instruction c.control) := c:Control.Cfgnext:Control.Cfgh:Control.step c = some next⊢ next.control ∈ nextControls (Control.instruction c.control) c:Control.Cfgnext:Control.Cfgh:(match Control.instruction c.control with | Control.Instr.halt => none | Control.Instr.jump n => some { control := n, regs := c.regs } | Control.Instr.inc r n => some { control := n, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 + 1) } | Control.Instr.decnz r p z => if (c.regs.getD (↑r) 0 == 0) = true then some { control := z, regs := c.regs } else some { control := p, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 - 1) }) = some next⊢ next.control ∈ nextControls (Control.instruction c.control) cases hi : Control.instruction c.control with c:Control.Cfgnext:Control.Cfgh:(match Control.instruction c.control with | Control.Instr.halt => none | Control.Instr.jump n => some { control := n, regs := c.regs } | Control.Instr.inc r n => some { control := n, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 + 1) } | Control.Instr.decnz r p z => if (c.regs.getD (↑r) 0 == 0) = true then some { control := z, regs := c.regs } else some { control := p, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 - 1) }) = some nexthi:Control.instruction c.control = Control.Instr.halt⊢ next.control ∈ nextControls Control.Instr.halt c:Control.Cfgnext:Control.Cfghi:Control.instruction c.control = Control.Instr.halth:none = some next⊢ next.control ∈ nextControls Control.Instr.halt; All goals completed! 🐙 c:Control.Cfgnext:Control.Cfgh:(match Control.instruction c.control with | Control.Instr.halt => none | Control.Instr.jump n => some { control := n, regs := c.regs } | Control.Instr.inc r n => some { control := n, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 + 1) } | Control.Instr.decnz r p z => if (c.regs.getD (↑r) 0 == 0) = true then some { control := z, regs := c.regs } else some { control := p, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 - 1) }) = some nextn:ControlWordhi:Control.instruction c.control = Control.Instr.jump n⊢ next.control ∈ nextControls (Control.Instr.jump n) c:Control.Cfgnext:Control.Cfgn:ControlWordhi:Control.instruction c.control = Control.Instr.jump nh:some { control := n, regs := c.regs } = some next⊢ next.control ∈ nextControls (Control.Instr.jump n); c:Control.Cfgn:ControlWordhi:Control.instruction c.control = Control.Instr.jump n⊢ { control := n, regs := c.regs }.control ∈ nextControls (Control.Instr.jump n); All goals completed! 🐙 c:Control.Cfgnext:Control.Cfgh:(match Control.instruction c.control with | Control.Instr.halt => none | Control.Instr.jump n => some { control := n, regs := c.regs } | Control.Instr.inc r n => some { control := n, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 + 1) } | Control.Instr.decnz r p z => if (c.regs.getD (↑r) 0 == 0) = true then some { control := z, regs := c.regs } else some { control := p, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 - 1) }) = some nextr:Fin 5n:ControlWordhi:Control.instruction c.control = Control.Instr.inc r n⊢ next.control ∈ nextControls (Control.Instr.inc r n) c:Control.Cfgnext:Control.Cfgr:Fin 5n:ControlWordhi:Control.instruction c.control = Control.Instr.inc r nh:some { control := n, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 + 1) } = some next⊢ next.control ∈ nextControls (Control.Instr.inc r n); c:Control.Cfgr:Fin 5n:ControlWordhi:Control.instruction c.control = Control.Instr.inc r n⊢ { control := n, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 + 1) }.control ∈ nextControls (Control.Instr.inc r n); All goals completed! 🐙 c:Control.Cfgnext:Control.Cfgh:(match Control.instruction c.control with | Control.Instr.halt => none | Control.Instr.jump n => some { control := n, regs := c.regs } | Control.Instr.inc r n => some { control := n, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 + 1) } | Control.Instr.decnz r p z => if (c.regs.getD (↑r) 0 == 0) = true then some { control := z, regs := c.regs } else some { control := p, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 - 1) }) = some nextr:Fin 5p:ControlWordz:ControlWordhi:Control.instruction c.control = Control.Instr.decnz r p z⊢ next.control ∈ nextControls (Control.Instr.decnz r p z) c:Control.Cfgnext:Control.Cfgr:Fin 5p:ControlWordz:ControlWordhi:Control.instruction c.control = Control.Instr.decnz r p zh:(if (c.regs.getD (↑r) 0 == 0) = true then some { control := z, regs := c.regs } else some { control := p, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 - 1) }) = some next⊢ next.control ∈ nextControls (Control.Instr.decnz r p z) c:Control.Cfgnext:Control.Cfgr:Fin 5p:ControlWordz:ControlWordhi:Control.instruction c.control = Control.Instr.decnz r p zh✝:(c.regs.getD (↑r) 0 == 0) = trueh:some { control := z, regs := c.regs } = some next⊢ next.control ∈ nextControls (Control.Instr.decnz r p z)c:Control.Cfgnext:Control.Cfgr:Fin 5p:ControlWordz:ControlWordhi:Control.instruction c.control = Control.Instr.decnz r p zh✝:¬(c.regs.getD (↑r) 0 == 0) = trueh:some { control := p, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 - 1) } = some next⊢ next.control ∈ nextControls (Control.Instr.decnz r p z) c:Control.Cfgnext:Control.Cfgr:Fin 5p:ControlWordz:ControlWordhi:Control.instruction c.control = Control.Instr.decnz r p zh✝:(c.regs.getD (↑r) 0 == 0) = trueh:some { control := z, regs := c.regs } = some next⊢ next.control ∈ nextControls (Control.Instr.decnz r p z)c:Control.Cfgnext:Control.Cfgr:Fin 5p:ControlWordz:ControlWordhi:Control.instruction c.control = Control.Instr.decnz r p zh✝:¬(c.regs.getD (↑r) 0 == 0) = trueh:some { control := p, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 - 1) } = some next⊢ next.control ∈ nextControls (Control.Instr.decnz r p z) c:Control.Cfgr:Fin 5p:ControlWordz:ControlWordhi:Control.instruction c.control = Control.Instr.decnz r p zh✝:¬(c.regs.getD (↑r) 0 == 0) = true⊢ { control := p, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 - 1) }.control ∈ nextControls (Control.Instr.decnz r p z) c:Control.Cfgr:Fin 5p:ControlWordz:ControlWordhi:Control.instruction c.control = Control.Instr.decnz r p zh✝:(c.regs.getD (↑r) 0 == 0) = true⊢ { control := z, regs := c.regs }.control ∈ nextControls (Control.Instr.decnz r p z)c:Control.Cfgr:Fin 5p:ControlWordz:ControlWordhi:Control.instruction c.control = Control.Instr.decnz r p zh✝:¬(c.regs.getD (↑r) 0 == 0) = true⊢ { control := p, regs := c.regs.set (↑r) (c.regs.getD (↑r) 0 - 1) }.control ∈ nextControls (Control.Instr.decnz r p z) All goals completed! 🐙theorem preStep_closed (c next : Control.Cfg) (hc : InPrewidth c.control) (h : preStep c = some next) : InPrewidth next.control := c:Control.Cfgnext:Control.Cfghc:InPrewidth c.controlh:preStep c = some next⊢ InPrewidth next.control cases hctrl : c.control with c:Control.Cfgnext:Control.Cfghc:InPrewidth c.controlh:preStep c = some nextd:ℕhctrl:c.control = ControlWord.entry d⊢ InPrewidth next.control All goals completed! 🐙 c:Control.Cfgnext:Control.Cfghc:InPrewidth c.controlh:preStep c = some nextd:ℕs:Fin 22hctrl:c.control = ControlWord.local d s⊢ InPrewidth next.control All goals completed! 🐙 c:Control.Cfgnext:Control.Cfghc:InPrewidth c.controlh:preStep c = some nexti:Fin 97hctrl:c.control = ControlWord.outside i⊢ InPrewidth next.control c:Control.Cfgnext:Control.Cfgh:preStep c = some nexti:Fin 97hc:InPrewidth (ControlWord.outside i)hctrl:c.control = ControlWord.outside i⊢ InPrewidth next.control c:Control.Cfgnext:Control.Cfgh:preStep c = some nexti:Fin 97hctrl:c.control = ControlWord.outside ihc:3 ≤ ↑i ∧ ↑i < 89⊢ InPrewidth next.control c:Control.Cfgnext:Control.Cfgh:preStep c = some nexti:Fin 97hctrl:c.control = ControlWord.outside ihc:3 ≤ ↑i ∧ ↑i < 89hcut:c.control ≠ ControlWord.outside 88⊢ InPrewidth next.control c:Control.Cfgnext:Control.Cfgh:preStep c = some nexti:Fin 97hctrl:c.control = ControlWord.outside ihc:3 ≤ ↑i ∧ ↑i < 89hcut:c.control ≠ ControlWord.outside 88hi:↑i ≠ 88⊢ InPrewidth next.control c:Control.Cfgnext:Control.Cfgh:preStep c = some nexti:Fin 97hctrl:c.control = ControlWord.outside ihc:3 ≤ ↑i ∧ ↑i < 89hcut:c.control ≠ ControlWord.outside 88hi:↑i ≠ 88hi88:↑i < 88⊢ InPrewidth next.control c:Control.Cfgnext:Control.Cfgh:preStep c = some nexti:Fin 97hctrl:c.control = ControlWord.outside ihc:3 ≤ ↑i ∧ ↑i < 89hcut:c.control ≠ ControlWord.outside 88hi:↑i ≠ 88hi88:↑i < 88j:Fin 85 := ⟨↑i - 3, ⋯⟩⊢ InPrewidth next.control c:Control.Cfgnext:Control.Cfgh:preStep c = some nexti:Fin 97hctrl:c.control = ControlWord.outside ihc:3 ≤ ↑i ∧ ↑i < 89hcut:c.control ≠ ControlWord.outside 88hi:↑i ≠ 88hi88:↑i < 88j:Fin 85 := ⟨↑i - 3, ⋯⟩hj:ctl85 j = i⊢ InPrewidth next.control c:Control.Cfgnext:Control.Cfgh:preStep c = some nexti:Fin 97hctrl:c.control = ControlWord.outside ihc:3 ≤ ↑i ∧ ↑i < 89hcut:c.control ≠ ControlWord.outside 88hi:↑i ≠ 88hi88:↑i < 88j:Fin 85 := ⟨↑i - 3, ⋯⟩hj:ctl85 j = ihs:Control.step c = some next⊢ InPrewidth next.control c:Control.Cfgnext:Control.Cfgh:preStep c = some nexti:Fin 97hctrl:c.control = ControlWord.outside ihc:3 ≤ ↑i ∧ ↑i < 89hcut:c.control ≠ ControlWord.outside 88hi:↑i ≠ 88hi88:↑i < 88j:Fin 85 := ⟨↑i - 3, ⋯⟩hj:ctl85 j = ihs:Control.step c = some nexthm:next.control ∈ nextControls (Control.instruction c.control)⊢ InPrewidth next.control c:Control.Cfgnext:Control.Cfgh:preStep c = some nexti:Fin 97hctrl:c.control = ControlWord.outside ihc:3 ≤ ↑i ∧ ↑i < 89hcut:c.control ≠ ControlWord.outside 88hi:↑i ≠ 88hi88:↑i < 88j:Fin 85 := ⟨↑i - 3, ⋯⟩hj:ctl85 j = ihs:Control.step c = some nexthm:next.control ∈ nextControls (Control.instruction (ControlWord.outside (ctl85 j)))⊢ InPrewidth next.control All goals completed! 🐙theorem preStep_encode (c : Control.Cfg) (hc : InPrewidth c.control) (hlen : c.regs.length = 5) : (preStep c).map encodeCfg = ReferencePreStep95 (encodeCfg c) := c:Control.Cfghc:InPrewidth c.controlhlen:c.regs.length = 5⊢ Option.map encodeCfg (preStep c) = ReferencePreStep95 (encodeCfg c) control:ControlWordregs:List ℕhc:InPrewidth { control := control, regs := regs }.controlhlen:{ control := control, regs := regs }.regs.length = 5⊢ Option.map encodeCfg (preStep { control := control, regs := regs }) = ReferencePreStep95 (encodeCfg { control := control, regs := regs }) cases control with regs:List ℕd:ℕhc:InPrewidth { control := ControlWord.entry d, regs := regs }.controlhlen:{ control := ControlWord.entry d, regs := regs }.regs.length = 5⊢ Option.map encodeCfg (preStep { control := ControlWord.entry d, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.entry d, regs := regs }) All goals completed! 🐙 regs:List ℕd:ℕs:Fin 22hc:InPrewidth { control := ControlWord.local d s, regs := regs }.controlhlen:{ control := ControlWord.local d s, regs := regs }.regs.length = 5⊢ Option.map encodeCfg (preStep { control := ControlWord.local d s, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.local d s, regs := regs }) All goals completed! 🐙 regs:List ℕi:Fin 97hc:InPrewidth { control := ControlWord.outside i, regs := regs }.controlhlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:↑i = 88⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs })regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:↑i = 88⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:↑i = 88he:i = 88⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕhlen:{ control := ControlWord.outside 88, regs := regs }.regs.length = 5hc:3 ≤ ↑88 ∧ ↑88 < 89hi:↑88 = 88⊢ Option.map encodeCfg (preStep { control := ControlWord.outside 88, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside 88, regs := regs }) All goals completed! 🐙 regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88hi88:↑i < 88⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88hi88:↑i < 88hword:word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩)⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88hi88:↑i < 88hword:word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩)hword_ne:word (ControlWord.outside i) ≠ ReferenceProgram.word 88⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88hi88:↑i < 88hword:word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩)hword_ne:word (ControlWord.outside i) ≠ ReferenceProgram.word 88hctrl_ne:ControlWord.outside i ≠ ControlWord.outside 88⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88hi88:↑i < 88hword:word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩)hword_ne:word (ControlWord.outside i) ≠ ReferenceProgram.word 88hctrl_ne:ControlWord.outside i ≠ ControlWord.outside 88hinstr:Control.rawInstr (ControlWord.outside i) = swapInstr (ReferenceProgram.decoded (ref85 ⟨↑i - 3, ⋯⟩))⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88hi88:↑i < 88hword:word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩)hword_ne:word (ControlWord.outside i) ≠ ReferenceProgram.word 88hctrl_ne:ControlWord.outside i ≠ ControlWord.outside 88hinstr:Control.rawInstr (ControlWord.outside i) = swapInstr (ReferenceProgram.decoded (ref85 ⟨↑i - 3, ⋯⟩))href_index:ref89 ⟨↑i, ⋯⟩ = ref85 ⟨↑i - 3, ⋯⟩⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88hi88:↑i < 88hword:word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩)hword_ne:word (ControlWord.outside i) ≠ ReferenceProgram.word 88hctrl_ne:ControlWord.outside i ≠ ControlWord.outside 88hinstr:Control.rawInstr (ControlWord.outside i) = swapInstr (ReferenceProgram.decoded (ref85 ⟨↑i - 3, ⋯⟩))href_index:ref89 ⟨↑i, ⋯⟩ = ref85 ⟨↑i - 3, ⋯⟩hbase:Option.map encodeCfg (Control.step { control := ControlWord.outside i, regs := regs }) = ReferenceProgram.step (encodeCfg { control := ControlWord.outside i, regs := regs })⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88hi88:↑i < 88hword:word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩)hword_ne:word (ControlWord.outside i) ≠ ReferenceProgram.word 88hctrl_ne:ControlWord.outside i ≠ ControlWord.outside 88hinstr:Control.rawInstr (ControlWord.outside i) = swapInstr (ReferenceProgram.decoded (ref85 ⟨↑i - 3, ⋯⟩))href_index:ref89 ⟨↑i, ⋯⟩ = ref85 ⟨↑i - 3, ⋯⟩hbase:Option.map encodeCfg (Control.step { control := ControlWord.outside i, regs := regs }) = ReferenceProgram.step (encodeCfg { control := ControlWord.outside i, regs := regs })hpre:preStep { control := ControlWord.outside i, regs := regs } = Control.step { control := ControlWord.outside i, regs := regs }⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88hi88:↑i < 88hword:word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩)hword_ne:word (ControlWord.outside i) ≠ ReferenceProgram.word 88hctrl_ne:ControlWord.outside i ≠ ControlWord.outside 88hinstr:Control.rawInstr (ControlWord.outside i) = swapInstr (ReferenceProgram.decoded (ref85 ⟨↑i - 3, ⋯⟩))href_index:ref89 ⟨↑i, ⋯⟩ = ref85 ⟨↑i - 3, ⋯⟩hbase:Option.map encodeCfg (Control.step { control := ControlWord.outside i, regs := regs }) = ReferenceProgram.step (encodeCfg { control := ControlWord.outside i, regs := regs })hpre:preStep { control := ControlWord.outside i, regs := regs } = Control.step { control := ControlWord.outside i, regs := regs }href:ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) = ReferenceProgram.step (encodeCfg { control := ControlWord.outside i, regs := regs })⊢ Option.map encodeCfg (preStep { control := ControlWord.outside i, regs := regs }) = ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) regs:List ℕi:Fin 97hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hi:¬↑i = 88hi88:↑i < 88hword:word (ControlWord.outside i) = ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩)hword_ne:word (ControlWord.outside i) ≠ ReferenceProgram.word 88hctrl_ne:ControlWord.outside i ≠ ControlWord.outside 88hinstr:Control.rawInstr (ControlWord.outside i) = swapInstr (ReferenceProgram.decoded (ref85 ⟨↑i - 3, ⋯⟩))href_index:ref89 ⟨↑i, ⋯⟩ = ref85 ⟨↑i - 3, ⋯⟩hbase:Option.map encodeCfg (Control.step { control := ControlWord.outside i, regs := regs }) = ReferenceProgram.step (encodeCfg { control := ControlWord.outside i, regs := regs })hpre:preStep { control := ControlWord.outside i, regs := regs } = Control.step { control := ControlWord.outside i, regs := regs }href:ReferencePreStep95 (encodeCfg { control := ControlWord.outside i, regs := regs }) = ReferenceProgram.step (encodeCfg { control := ControlWord.outside i, regs := regs })⊢ Option.map encodeCfg (Control.step { control := ControlWord.outside i, regs := regs }) = ReferenceProgram.step (encodeCfg { control := ControlWord.outside i, regs := regs }) All goals completed! 🐙theorem edge_transport (c : Control.Cfg) (next : RhRegCfg) (hc : InPrewidth c.control) (hlen : c.regs.length = 5) (h : ReferencePreStep95 (encodeCfg c) = some next) : ∃ target : Control.Cfg, Control.BoundedEdge 19 c target ∧ encodeCfg target = next ∧ InPrewidth target.control ∧ target.regs.length = 5 := c:Control.Cfgnext:RhRegCfghc:InPrewidth c.controlhlen:c.regs.length = 5h:ReferencePreStep95 (encodeCfg c) = some next⊢ ∃ target, Control.BoundedEdge 19 c target ∧ encodeCfg target = next ∧ InPrewidth target.control ∧ target.regs.length = 5 c:Control.Cfgnext:RhRegCfghc:InPrewidth c.controlhlen:c.regs.length = 5h:ReferencePreStep95 (encodeCfg c) = some nexthm:Option.map encodeCfg (preStep c) = some next⊢ ∃ target, Control.BoundedEdge 19 c target ∧ encodeCfg target = next ∧ InPrewidth target.control ∧ target.regs.length = 5 cases hs : preStep c with c:Control.Cfgnext:RhRegCfghc:InPrewidth c.controlhlen:c.regs.length = 5h:ReferencePreStep95 (encodeCfg c) = some nexthm:Option.map encodeCfg (preStep c) = some nexths:preStep c = none⊢ ∃ target, Control.BoundedEdge 19 c target ∧ encodeCfg target = next ∧ InPrewidth target.control ∧ target.regs.length = 5 c:Control.Cfgnext:RhRegCfghc:InPrewidth c.controlhlen:c.regs.length = 5h:ReferencePreStep95 (encodeCfg c) = some nexths:preStep c = nonehm:none = some next⊢ ∃ target, Control.BoundedEdge 19 c target ∧ encodeCfg target = next ∧ InPrewidth target.control ∧ target.regs.length = 5; All goals completed! 🐙 c:Control.Cfgnext:RhRegCfghc:InPrewidth c.controlhlen:c.regs.length = 5h:ReferencePreStep95 (encodeCfg c) = some nexthm:Option.map encodeCfg (preStep c) = some nexttarget:Control.Cfghs:preStep c = some target⊢ ∃ target, Control.BoundedEdge 19 c target ∧ encodeCfg target = next ∧ InPrewidth target.control ∧ target.regs.length = 5 c:Control.Cfgnext:RhRegCfghc:InPrewidth c.controlhlen:c.regs.length = 5h:ReferencePreStep95 (encodeCfg c) = some nexthm:Option.map encodeCfg (preStep c) = some nexttarget:Control.Cfghs:preStep c = some targethe:encodeCfg target = next⊢ ∃ target, Control.BoundedEdge 19 c target ∧ encodeCfg target = next ∧ InPrewidth target.control ∧ target.regs.length = 5 c:Control.Cfgnext:RhRegCfghc:InPrewidth c.controlhlen:c.regs.length = 5h:ReferencePreStep95 (encodeCfg c) = some nexthm:Option.map encodeCfg (preStep c) = some nexttarget:Control.Cfghs:preStep c = some targethe:encodeCfg target = nextht:InPrewidth target.control⊢ ∃ target, Control.BoundedEdge 19 c target ∧ encodeCfg target = next ∧ InPrewidth target.control ∧ target.regs.length = 5 c:Control.Cfgnext:RhRegCfghc:InPrewidth c.controlhlen:c.regs.length = 5h:ReferencePreStep95 (encodeCfg c) = some nexthm:Option.map encodeCfg (preStep c) = some nexttarget:Control.Cfghs:preStep c = some targethe:encodeCfg target = nextht:InPrewidth target.controlhstep:Control.step c = some target⊢ ∃ target, Control.BoundedEdge 19 c target ∧ encodeCfg target = next ∧ InPrewidth target.control ∧ target.regs.length = 5 c:Control.Cfgnext:RhRegCfghc:InPrewidth c.controlhlen:c.regs.length = 5h:ReferencePreStep95 (encodeCfg c) = some nexthm:Option.map encodeCfg (preStep c) = some nexttarget:Control.Cfghs:preStep c = some targethe:encodeCfg target = nextht:InPrewidth target.controlhstep:Control.step c = some targethbound:List.length (Control.walked c.control) + 3 ≤ 19⊢ ∃ target, Control.BoundedEdge 19 c target ∧ encodeCfg target = next ∧ InPrewidth target.control ∧ target.regs.length = 5 All goals completed! 🐙theorem trace_transport {a b : RhRegCfg} (h : StateTransition.Reaches₁ ReferencePreStep95 a b) (c : Control.Cfg) (he : encodeCfg c = a) (hc : InPrewidth c.control) (hlen : c.regs.length = 5) : ∃ target : Control.Cfg, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5 := a:RhRegCfgb:RhRegCfgh:StateTransition.Reaches₁ ReferencePreStep95 a bc:Control.Cfghe:encodeCfg c = ahc:InPrewidth c.controlhlen:c.regs.length = 5⊢ ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5 induction h generalizing c with a:RhRegCfgb✝:RhRegCfgb:RhRegCfghs:b ∈ ReferencePreStep95 ac:Control.Cfghe:encodeCfg c = ahc:InPrewidth c.controlhlen:c.regs.length = 5⊢ ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5 a:RhRegCfgb✝:RhRegCfgb:RhRegCfghs:b ∈ ReferencePreStep95 ac:Control.Cfghe:encodeCfg c = ahc:InPrewidth c.controlhlen:c.regs.length = 5hs':ReferencePreStep95 a = some b⊢ ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5 a:RhRegCfgb✝:RhRegCfgb:RhRegCfghs:b ∈ ReferencePreStep95 ac:Control.Cfghe:encodeCfg c = ahc:InPrewidth c.controlhlen:c.regs.length = 5hs':ReferencePreStep95 (encodeCfg c) = some b⊢ ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5 a:RhRegCfgb✝:RhRegCfgb:RhRegCfghs:b ∈ ReferencePreStep95 ac:Control.Cfghe:encodeCfg c = ahc:InPrewidth c.controlhlen:c.regs.length = 5hs':ReferencePreStep95 (encodeCfg c) = some btarget:Control.Cfght:Control.BoundedEdge 19 c targethe':encodeCfg target = bhc':InPrewidth target.controlhl':target.regs.length = 5⊢ ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5 All goals completed! 🐙 a:RhRegCfgb✝:RhRegCfgb:RhRegCfgd:RhRegCfgh:Relation.TransGen (fun a b ↦ b ∈ ReferencePreStep95 a) a bhs:d ∈ ReferencePreStep95 bih:∀ (c : Control.Cfg), encodeCfg c = a → InPrewidth c.control → c.regs.length = 5 → ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5c:Control.Cfghe:encodeCfg c = ahc:InPrewidth c.controlhlen:c.regs.length = 5⊢ ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = d ∧ InPrewidth target.control ∧ target.regs.length = 5 a:RhRegCfgb✝:RhRegCfgb:RhRegCfgd:RhRegCfgh:Relation.TransGen (fun a b ↦ b ∈ ReferencePreStep95 a) a bhs:d ∈ ReferencePreStep95 bih:∀ (c : Control.Cfg), encodeCfg c = a → InPrewidth c.control → c.regs.length = 5 → ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5c:Control.Cfghe:encodeCfg c = ahc:InPrewidth c.controlhlen:c.regs.length = 5mid:Control.Cfght:Relation.TransGen (Control.BoundedEdge 19) c midhem:encodeCfg mid = bhcm:InPrewidth mid.controlhlm:mid.regs.length = 5⊢ ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = d ∧ InPrewidth target.control ∧ target.regs.length = 5 a:RhRegCfgb✝:RhRegCfgb:RhRegCfgd:RhRegCfgh:Relation.TransGen (fun a b ↦ b ∈ ReferencePreStep95 a) a bhs:d ∈ ReferencePreStep95 bih:∀ (c : Control.Cfg), encodeCfg c = a → InPrewidth c.control → c.regs.length = 5 → ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5c:Control.Cfghe:encodeCfg c = ahc:InPrewidth c.controlhlen:c.regs.length = 5mid:Control.Cfght:Relation.TransGen (Control.BoundedEdge 19) c midhem:encodeCfg mid = bhcm:InPrewidth mid.controlhlm:mid.regs.length = 5hs':ReferencePreStep95 b = some d⊢ ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = d ∧ InPrewidth target.control ∧ target.regs.length = 5 a:RhRegCfgb✝:RhRegCfgb:RhRegCfgd:RhRegCfgh:Relation.TransGen (fun a b ↦ b ∈ ReferencePreStep95 a) a bhs:d ∈ ReferencePreStep95 bih:∀ (c : Control.Cfg), encodeCfg c = a → InPrewidth c.control → c.regs.length = 5 → ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5c:Control.Cfghe:encodeCfg c = ahc:InPrewidth c.controlhlen:c.regs.length = 5mid:Control.Cfght:Relation.TransGen (Control.BoundedEdge 19) c midhem:encodeCfg mid = bhcm:InPrewidth mid.controlhlm:mid.regs.length = 5hs':ReferencePreStep95 (encodeCfg mid) = some d⊢ ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = d ∧ InPrewidth target.control ∧ target.regs.length = 5 a:RhRegCfgb✝:RhRegCfgb:RhRegCfgd:RhRegCfgh:Relation.TransGen (fun a b ↦ b ∈ ReferencePreStep95 a) a bhs:d ∈ ReferencePreStep95 bih:∀ (c : Control.Cfg), encodeCfg c = a → InPrewidth c.control → c.regs.length = 5 → ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = b ∧ InPrewidth target.control ∧ target.regs.length = 5c:Control.Cfghe:encodeCfg c = ahc:InPrewidth c.controlhlen:c.regs.length = 5mid:Control.Cfght:Relation.TransGen (Control.BoundedEdge 19) c midhem:encodeCfg mid = bhcm:InPrewidth mid.controlhlm:mid.regs.length = 5hs':ReferencePreStep95 (encodeCfg mid) = some dtarget:Control.Cfghlast:Control.BoundedEdge 19 mid targethe':encodeCfg target = dhc':InPrewidth target.controlhl':target.regs.length = 5⊢ ∃ target, Relation.TransGen (Control.BoundedEdge 19) c target ∧ encodeCfg target = d ∧ InPrewidth target.control ∧ target.regs.length = 5 All goals completed! 🐙theorem post_prewidth (M : Nat) : Relation.TransGen (Control.BoundedEdge 19) (⟨.outside 3,[0,0,M,0,0]⟩ : Control.Cfg) ⟨.outside 88,[0,0,Riemann120.shuniaDeficit (M+2),0,M+1]⟩ := M:ℕ⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.control⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controltarget:Control.Cfght:Relation.TransGen (Control.BoundedEdge 19) start targethe:encodeCfg target = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hc:InPrewidth target.controlhlen:target.regs.length = 5⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlcontrol:ControlWordregs:List ℕht:Relation.TransGen (Control.BoundedEdge 19) start { control := control, regs := regs }he:encodeCfg { control := control, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hc:InPrewidth { control := control, regs := regs }.controlhlen:{ control := control, regs := regs }.regs.length = 5⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } cases control with M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕd:ℕht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.entry d, regs := regs }he:encodeCfg { control := ControlWord.entry d, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hc:InPrewidth { control := ControlWord.entry d, regs := regs }.controlhlen:{ control := ControlWord.entry d, regs := regs }.regs.length = 5⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } All goals completed! 🐙 M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕd:ℕs:Fin 22ht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.local d s, regs := regs }he:encodeCfg { control := ControlWord.local d s, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hc:InPrewidth { control := ControlWord.local d s, regs := regs }.controlhlen:{ control := ControlWord.local d s, regs := regs }.regs.length = 5⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } All goals completed! 🐙 M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕi:Fin 97ht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside i, regs := regs }he:encodeCfg { control := ControlWord.outside i, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hc:InPrewidth { control := ControlWord.outside i, regs := regs }.controlhlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕi:Fin 97ht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside i, regs := regs }he:encodeCfg { control := ControlWord.outside i, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕi:Fin 97ht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside i, regs := regs }he:encodeCfg { control := ControlWord.outside i, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hstack:(encodeCfg { control := ControlWord.outside i, regs := regs }).stack = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }.stack⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕi:Fin 97ht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside i, regs := regs }he:encodeCfg { control := ControlWord.outside i, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hstack:(encodeCfg { control := ControlWord.outside i, regs := regs }).stack = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }.stackhregs:(encodeCfg { control := ControlWord.outside i, regs := regs }).regs = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }.regs⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕi:Fin 97ht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside i, regs := regs }he:encodeCfg { control := ControlWord.outside i, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hregs:(encodeCfg { control := ControlWord.outside i, regs := regs }).regs = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }.regshstack:word (ControlWord.outside i) = ReferenceProgram.word 88⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕi:Fin 97ht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside i, regs := regs }he:encodeCfg { control := ControlWord.outside i, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hregs:(encodeCfg { control := ControlWord.outside i, regs := regs }).regs = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }.regshstack:ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩) = ReferenceProgram.word 88⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕi:Fin 97ht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside i, regs := regs }he:encodeCfg { control := ControlWord.outside i, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hregs:(encodeCfg { control := ControlWord.outside i, regs := regs }).regs = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }.regshstack:ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩) = ReferenceProgram.word 88hi:↑⟨↑i, ⋯⟩ = 88⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕi:Fin 97ht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside i, regs := regs }he:encodeCfg { control := ControlWord.outside i, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside i, regs := regs }.regs.length = 5hc:3 ≤ ↑i ∧ ↑i < 89hregs:(encodeCfg { control := ControlWord.outside i, regs := regs }).regs = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }.regshstack:ReferenceProgram.word (ref89 ⟨↑i, ⋯⟩) = ReferenceProgram.word 88hi:↑⟨↑i, ⋯⟩ = 88hi':i = 88⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside 88, regs := regs }he:encodeCfg { control := ControlWord.outside 88, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside 88, regs := regs }.regs.length = 5hc:3 ≤ ↑88 ∧ ↑88 < 89hregs:(encodeCfg { control := ControlWord.outside 88, regs := regs }).regs = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }.regshstack:ReferenceProgram.word (ref89 ⟨↑88, ⋯⟩) = ReferenceProgram.word 88hi:↑⟨↑88, ⋯⟩ = 88⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside 88, regs := regs }he:encodeCfg { control := ControlWord.outside 88, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside 88, regs := regs }.regs.length = 5hc:3 ≤ ↑88 ∧ ↑88 < 89hstack:ReferenceProgram.word (ref89 ⟨↑88, ⋯⟩) = ReferenceProgram.word 88hi:↑⟨↑88, ⋯⟩ = 88hregs:swapBank regs = [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1]⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside 88, regs := regs }he:encodeCfg { control := ControlWord.outside 88, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside 88, regs := regs }.regs.length = 5hc:3 ≤ ↑88 ∧ ↑88 < 89hstack:ReferenceProgram.word (ref89 ⟨↑88, ⋯⟩) = ReferenceProgram.word 88hi:↑⟨↑88, ⋯⟩ = 88hregs:swapBank regs = [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1]hr:swapBank (swapBank regs) = swapBank [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1]⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside 88, regs := regs }he:encodeCfg { control := ControlWord.outside 88, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside 88, regs := regs }.regs.length = 5hc:3 ≤ ↑88 ∧ ↑88 < 89hstack:ReferenceProgram.word (ref89 ⟨↑88, ⋯⟩) = ReferenceProgram.word 88hi:↑⟨↑88, ⋯⟩ = 88hregs:swapBank regs = [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1]hr:regs = swapBank [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1]⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlregs:List ℕht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside 88, regs := regs }he:encodeCfg { control := ControlWord.outside 88, regs := regs } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside 88, regs := regs }.regs.length = 5hc:3 ≤ ↑88 ∧ ↑88 < 89hstack:ReferenceProgram.word (ref89 ⟨↑88, ⋯⟩) = ReferenceProgram.word 88hi:↑⟨↑88, ⋯⟩ = 88hregs:swapBank regs = [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1]hr:regs = [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1]⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕstart:Control.Cfg := { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }hstart:encodeCfg start = { stack := ReferenceProgram.word 3, regs := [0, 0, M, 0, 0] }hscope:InPrewidth start.controlhc:3 ≤ ↑88 ∧ ↑88 < 89hstack:ReferenceProgram.word (ref89 ⟨↑88, ⋯⟩) = ReferenceProgram.word 88hi:↑⟨↑88, ⋯⟩ = 88ht:Relation.TransGen (Control.BoundedEdge 19) start { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }he:encodeCfg { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } = { stack := ReferenceProgram.word 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }hlen:{ control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] }.regs.length = 5hregs:swapBank [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] = [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1]⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } All goals completed! 🐙theorem stage_prewidth (M : Nat) : Relation.TransGen (Control.BoundedEdge 19) (⟨.outside 0,[0,0,0,M,0]⟩ : Control.Cfg) ⟨.outside 88,[0,0,Riemann120.shuniaDeficit (M+2),0,M+1]⟩ := M:ℕ⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 0, regs := [0, 0, 0, M, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕhi:Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 0, regs := [0, 0, 0, M, 0] } { control := ControlWord.outside 3, regs := [0, 0, 0 + M, 0, 0] }⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 0, regs := [0, 0, 0, M, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } M:ℕhi:Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 0, regs := [0, 0, 0, M, 0] } { control := ControlWord.outside 3, regs := [0, 0, M, 0, 0] }⊢ Relation.TransGen (Control.BoundedEdge 19) { control := ControlWord.outside 0, regs := [0, 0, 0, M, 0] } { control := ControlWord.outside 88, regs := [0, 0, Riemann120.shuniaDeficit (M + 2), 0, M + 1] } All goals completed! 🐙end ConjectureMachines.Riemann95.TypedPrewidth