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.Bounded95 public import Cryptids.ReductionSupport.Riemann95.Algorithm95
@[expose] public sectionnamespace ConjectureMachines.Riemann95.Controlopen StateTransition Schemaopen ConjectureMachines.Riemann120 (quarterClock)theorem unwind_frontier_bound (d f x : Nat) : (walked (⟨unwind d,[0,0,f,x,0]⟩ : Cfg).control).length + 3 ≤ 5 * d + 18 := d:ℕf:ℕx:ℕ⊢ List.length (walked { control := unwind d, regs := [0, 0, f, x, 0] }.control) + 3 ≤ 5 * d + 18 d:ℕf:ℕx:ℕh:List.length (localWalk d unwindId) ≤ 5 * d + 14⊢ List.length (walked { control := unwind d, regs := [0, 0, f, x, 0] }.control) + 3 ≤ 5 * d + 18 d:ℕf:ℕx:ℕh:List.length (localWalk d unwindId) ≤ 5 * d + 14⊢ List.length (localWalk d unwindId) + 3 ≤ 5 * d + 18 All goals completed! 🐙theorem bounded_unwind_edge (B d f x : Nat) (hB : 5 * d + 18 ≤ B) (next : Cfg) (he : step ⟨unwind d, [0, 0, f, x, 0]⟩ = some next) : BoundedEdge B ⟨unwind d,[0,0,f,x,0]⟩ next := ⟨he,le_trans (unwind_frontier_bound d f x) hB⟩theorem bounded_unwind_eval (B d x f : Nat) (hB : 5 * d + 18 ≤ B) : Relation.TransGen (BoundedEdge B) ⟨unwind d,[0,0,f,x,0]⟩ ⟨if f ≤ d ∧ (d-f)%2 = 0 then .outside 0 else .outside finalTestId, [0,0,f-(d+1),x,0]⟩ := B:ℕd:ℕx:ℕf:ℕhB:5 * d + 18 ≤ B⊢ Relation.TransGen (BoundedEdge B) { control := unwind d, regs := [0, 0, f, x, 0] } { control := if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1), x, 0] } induction d using Nat.strong_induction_on generalizing f with B:ℕx:ℕd:ℕih:∀ m < d, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }f:ℕhB:5 * d + 18 ≤ B⊢ Relation.TransGen (BoundedEdge B) { control := unwind d, regs := [0, 0, f, x, 0] } { control := if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1), x, 0] } cases d with B:ℕx:ℕf:ℕih:∀ m < 0, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * 0 + 18 ≤ B⊢ Relation.TransGen (BoundedEdge B) { control := unwind 0, regs := [0, 0, f, x, 0] } { control := if f ≤ 0 ∧ (0 - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (0 + 1), x, 0] } cases f with B:ℕx:ℕih:∀ m < 0, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * 0 + 18 ≤ B⊢ Relation.TransGen (BoundedEdge B) { control := unwind 0, regs := [0, 0, 0, x, 0] } { control := if 0 ≤ 0 ∧ (0 - 0) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, 0 - (0 + 1), x, 0] } exact Relation.TransGen.single (B:ℕx:ℕih:∀ m < 0, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * 0 + 18 ≤ B⊢ BoundedEdge B { control := unwind 0, regs := [0, 0, 0, x, 0] } { control := if 0 ≤ 0 ∧ (0 - 0) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, 0 - (0 + 1), x, 0] } All goals completed! 🐙) B:ℕx:ℕih:∀ m < 0, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * 0 + 18 ≤ Bf:ℕ⊢ Relation.TransGen (BoundedEdge B) { control := unwind 0, regs := [0, 0, f + 1, x, 0] } { control := if f + 1 ≤ 0 ∧ (0 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f + 1 - (0 + 1), x, 0] } exact Relation.TransGen.single (B:ℕx:ℕih:∀ m < 0, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * 0 + 18 ≤ Bf:ℕ⊢ BoundedEdge B { control := unwind 0, regs := [0, 0, f + 1, x, 0] } { control := if f + 1 ≤ 0 ∧ (0 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f + 1 - (0 + 1), x, 0] } All goals completed! 🐙) B:ℕx:ℕf:ℕd:ℕih:∀ m < d + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1) + 18 ≤ B⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f, x, 0] } { control := if f ≤ d + 1 ∧ (d + 1 - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1 + 1), x, 0] } cases f with B:ℕx:ℕd:ℕih:∀ m < d + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1) + 18 ≤ B⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, 0, x, 0] } { control := if 0 ≤ d + 1 ∧ (d + 1 - 0) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, 0 - (d + 1 + 1), x, 0] } cases d with B:ℕx:ℕih:∀ m < 0 + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (0 + 1) + 18 ≤ B⊢ Relation.TransGen (BoundedEdge B) { control := unwind (0 + 1), regs := [0, 0, 0, x, 0] } { control := if 0 ≤ 0 + 1 ∧ (0 + 1 - 0) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, 0 - (0 + 1 + 1), x, 0] } exact Relation.TransGen.single (B:ℕx:ℕih:∀ m < 0 + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (0 + 1) + 18 ≤ B⊢ BoundedEdge B { control := unwind (0 + 1), regs := [0, 0, 0, x, 0] } { control := if 0 ≤ 0 + 1 ∧ (0 + 1 - 0) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, 0 - (0 + 1 + 1), x, 0] } All goals completed! 🐙) B:ℕx:ℕd:ℕih:∀ m < d + 1 + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1 + 1) + 18 ≤ B⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1 + 1), regs := [0, 0, 0, x, 0] } { control := if 0 ≤ d + 1 + 1 ∧ (d + 1 + 1 - 0) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, 0 - (d + 1 + 1 + 1), x, 0] } B:ℕx:ℕd:ℕih:∀ m < d + 1 + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1 + 1) + 18 ≤ Bhs:Relation.TransGen (BoundedEdge B) { control := unwind (d + 2), regs := [0, 0, 0, x, 0] } { control := unwind d, regs := [0, 0, 0, x, 0] }⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1 + 1), regs := [0, 0, 0, x, 0] } { control := if 0 ≤ d + 1 + 1 ∧ (d + 1 + 1 - 0) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, 0 - (d + 1 + 1 + 1), x, 0] } B:ℕx:ℕd:ℕih:∀ m < d + 1 + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1 + 1) + 18 ≤ Bhs:Relation.TransGen (BoundedEdge B) { control := unwind (d + 2), regs := [0, 0, 0, x, 0] } { control := unwind d, regs := [0, 0, 0, x, 0] }hpar:(d + 1 + 1) % 2 = d % 2⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1 + 1), regs := [0, 0, 0, x, 0] } { control := if 0 ≤ d + 1 + 1 ∧ (d + 1 + 1 - 0) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, 0 - (d + 1 + 1 + 1), x, 0] } B:ℕx:ℕd:ℕih:∀ m < d + 1 + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1 + 1) + 18 ≤ Bhs:Relation.TransGen (BoundedEdge B) { control := unwind (d + 2), regs := [0, 0, 0, x, 0] } { control := unwind d, regs := [0, 0, 0, x, 0] }hpar:(d + 1 + 1) % 2 = d % 2hi:Relation.TransGen (BoundedEdge B) { control := unwind d, regs := [0, 0, 0, x, 0] } { control := if 0 ≤ d ∧ (d - 0) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, 0 - (d + 1), x, 0] }⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1 + 1), regs := [0, 0, 0, x, 0] } { control := if 0 ≤ d + 1 + 1 ∧ (d + 1 + 1 - 0) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, 0 - (d + 1 + 1 + 1), x, 0] } All goals completed! 🐙 B:ℕx:ℕd:ℕih:∀ m < d + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1) + 18 ≤ Bf:ℕ⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := if f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f + 1 - (d + 1 + 1), x, 0] } B:ℕx:ℕd:ℕih:∀ m < d + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1) + 18 ≤ Bf:ℕhs:Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := if f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f + 1 - (d + 1 + 1), x, 0] } B:ℕx:ℕd:ℕih:∀ m < d + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1) + 18 ≤ Bf:ℕhs:Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hc:f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 ↔ f ≤ d ∧ (d - f) % 2 = 0⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := if f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f + 1 - (d + 1 + 1), x, 0] } B:ℕx:ℕd:ℕih:∀ m < d + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1) + 18 ≤ Bf:ℕhs:Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hc:f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 ↔ f ≤ d ∧ (d - f) % 2 = 0hsub:f + 1 - (d + 1 + 1) = f - (d + 1)⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := if f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f + 1 - (d + 1 + 1), x, 0] } B:ℕx:ℕd:ℕih:∀ m < d + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1) + 18 ≤ Bf:ℕhs:Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hc:f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 ↔ f ≤ d ∧ (d - f) % 2 = 0hsub:f + 1 - (d + 1 + 1) = f - (d + 1)hite:(if f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId) = if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := if f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f + 1 - (d + 1 + 1), x, 0] } B:ℕx:ℕd:ℕih:∀ m < d + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1) + 18 ≤ Bf:ℕhs:Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hc:f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 ↔ f ≤ d ∧ (d - f) % 2 = 0hsub:f + 1 - (d + 1 + 1) = f - (d + 1)hite:(if f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId) = if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId⊢ Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1), x, 0] } exact hs.trans (ih d (B:ℕx:ℕd:ℕih:∀ m < d + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1) + 18 ≤ Bf:ℕhs:Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hc:f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 ↔ f ≤ d ∧ (d - f) % 2 = 0hsub:f + 1 - (d + 1 + 1) = f - (d + 1)hite:(if f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId) = if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId⊢ d < d + 1 All goals completed! 🐙) f (B:ℕx:ℕd:ℕih:∀ m < d + 1, ∀ (f : ℕ), 5 * m + 18 ≤ B → Relation.TransGen (BoundedEdge B) { control := unwind m, regs := [0, 0, f, x, 0] } { control := if f ≤ m ∧ (m - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (m + 1), x, 0] }hB:5 * (d + 1) + 18 ≤ Bf:ℕhs:Relation.TransGen (BoundedEdge B) { control := unwind (d + 1), regs := [0, 0, f + 1, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hc:f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 ↔ f ≤ d ∧ (d - f) % 2 = 0hsub:f + 1 - (d + 1 + 1) = f - (d + 1)hite:(if f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId) = if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId⊢ 5 * d + 18 ≤ B All goals completed! 🐙))theorem outside_frontier_bound (s : Fin 97) : (walked (.outside s)).length + 3 ≤ 19 := Nat.add_le_add_right (outsideWalk_length s) 3theorem bounded_finish (J q f x : Nat) (hq : q ≤ quarterClock J) : Relation.TransGen (BoundedEdge (widthBudget J)) ⟨.entry q,[0,0,f,x,0]⟩ ⟨if f-q = 0 then .outside 0 else .outside finalHaltId,[0,0,(f-q)-1,x,0]⟩ := J:ℕq:ℕf:ℕx:ℕhq:q ≤ quarterClock J⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry q, regs := [0, 0, f, x, 0] } { control := if f - q = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - q - 1, x, 0] } J:ℕq:ℕf:ℕx:ℕhq:q ≤ quarterClock Jhbudget:19 ≤ widthBudget J⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry q, regs := [0, 0, f, x, 0] } { control := if f - q = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - q - 1, x, 0] } J:ℕq:ℕf:ℕx:ℕhq:q ≤ quarterClock Jhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry q, regs := [0, 0, f, x, 0] } { control := if f - q = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - q - 1, x, 0] } J:ℕq:ℕf:ℕx:ℕhq:q ≤ quarterClock Jhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry q, regs := [0, 0, f, x, 0] } { control := if f - q = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - q - 1, x, 0] } cases q with J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }hq:0 ≤ quarterClock J⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry 0, regs := [0, 0, f, x, 0] } { control := if f - 0 = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - 0 - 1, x, 0] } J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }hq:0 ≤ quarterClock Jhs:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry 0, regs := [0, 0, f, x, 0] } { control := ControlWord.outside finalTestId, regs := [0, 0, f, x, 0] }⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry 0, regs := [0, 0, f, x, 0] } { control := if f - 0 = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - 0 - 1, x, 0] } All goals completed! 🐙 J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }d:ℕhq:d + 1 ≤ quarterClock J⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f - (d + 1) = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - (d + 1) - 1, x, 0] } J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }d:ℕhq:d + 1 ≤ quarterClock Jhs:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f - (d + 1) = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - (d + 1) - 1, x, 0] } J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }d:ℕhq:d + 1 ≤ quarterClock Jhs:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hlocal:5 * d + 18 ≤ widthBudget J⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f - (d + 1) = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - (d + 1) - 1, x, 0] } J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }d:ℕhq:d + 1 ≤ quarterClock Jhs:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hlocal:5 * d + 18 ≤ widthBudget Jhu:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1), x, 0] }⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f - (d + 1) = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - (d + 1) - 1, x, 0] } J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }d:ℕhq:d + 1 ≤ quarterClock Jhs:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hlocal:5 * d + 18 ≤ widthBudget Jhu:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1), x, 0] }hc:f ≤ d ∧ (d - f) % 2 = 0⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f - (d + 1) = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - (d + 1) - 1, x, 0] }J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }d:ℕhq:d + 1 ≤ quarterClock Jhs:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hlocal:5 * d + 18 ≤ widthBudget Jhu:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1), x, 0] }hc:¬(f ≤ d ∧ (d - f) % 2 = 0)⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f - (d + 1) = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - (d + 1) - 1, x, 0] } J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }d:ℕhq:d + 1 ≤ quarterClock Jhs:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hlocal:5 * d + 18 ≤ widthBudget Jhu:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1), x, 0] }hc:f ≤ d ∧ (d - f) % 2 = 0⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f - (d + 1) = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - (d + 1) - 1, x, 0] } J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }d:ℕhq:d + 1 ≤ quarterClock Jhs:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hlocal:5 * d + 18 ≤ widthBudget Jhu:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1), x, 0] }hc:f ≤ d ∧ (d - f) % 2 = 0hz:f - (d + 1) = 0⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f - (d + 1) = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - (d + 1) - 1, x, 0] } All goals completed! 🐙 J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }d:ℕhq:d + 1 ≤ quarterClock Jhs:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hlocal:5 * d + 18 ≤ widthBudget Jhu:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1), x, 0] }hc:¬(f ≤ d ∧ (d - f) % 2 = 0)⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f - (d + 1) = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - (d + 1) - 1, x, 0] } J:ℕf:ℕx:ℕhbudget:19 ≤ widthBudget Jhmax:10 + 5 * quarterClock J ≤ max 16 (10 + 5 * quarterClock J)test:∀ (a : ℕ), Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.outside finalTestId, regs := [0, 0, a, x, 0] } { control := if a = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, a - 1, x, 0] }d:ℕhq:d + 1 ≤ quarterClock Jhs:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := unwind d, regs := [0, 0, f, x, 0] }hlocal:5 * d + 18 ≤ widthBudget Jhc:¬(f ≤ d ∧ (d - f) % 2 = 0)hu:Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := ControlWord.outside finalTestId, regs := [0, 0, f - (d + 1), x, 0] }⊢ Relation.TransGen (BoundedEdge (widthBudget J)) { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } { control := if f - (d + 1) = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f - (d + 1) - 1, x, 0] } All goals completed! 🐙theorem bounded_width_outcome (x j f : Nat) : Relation.TransGen (BoundedEdge (widthBudget j)) ⟨.entry 0,[0,0,f,x,j]⟩ ⟨if Algorithm.residual j f = 0 then .outside 0 else .outside finalHaltId, [0,0,Algorithm.residual j f-1,x,0]⟩ := x:ℕj:ℕf:ℕ⊢ Relation.TransGen (BoundedEdge (widthBudget j)) { control := ControlWord.entry 0, regs := [0, 0, f, x, j] } { control := if Algorithm.residual j f = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, Algorithm.residual j f - 1, x, 0] } x:ℕj:ℕf:ℕhd:Relation.ReflTransGen (BoundedEdge (widthBudget j)) { control := ControlWord.entry 0, regs := [0, 0, f, x, j] } { control := ControlWord.entry (0 + quarterClock j), regs := [0, 0, f / 2 ^ quarterClock j, x, 0] }⊢ Relation.TransGen (BoundedEdge (widthBudget j)) { control := ControlWord.entry 0, regs := [0, 0, f, x, j] } { control := if Algorithm.residual j f = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, Algorithm.residual j f - 1, x, 0] } x:ℕj:ℕf:ℕhd:Relation.ReflTransGen (BoundedEdge (widthBudget j)) { control := ControlWord.entry 0, regs := [0, 0, f, x, j] } { control := ControlWord.entry (quarterClock j), regs := [0, 0, f / 2 ^ quarterClock j, x, 0] }⊢ Relation.TransGen (BoundedEdge (widthBudget j)) { control := ControlWord.entry 0, regs := [0, 0, f, x, j] } { control := if Algorithm.residual j f = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, Algorithm.residual j f - 1, x, 0] } x:ℕj:ℕf:ℕhd:Relation.ReflTransGen (BoundedEdge (widthBudget j)) { control := ControlWord.entry 0, regs := [0, 0, f, x, j] } { control := ControlWord.entry (quarterClock j), regs := [0, 0, f / 2 ^ quarterClock j, x, 0] }hf:Relation.TransGen (BoundedEdge (widthBudget j)) { control := ControlWord.entry 0, regs := [0, 0, f, x, j] } { control := if f / 2 ^ quarterClock j - quarterClock j = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, f / 2 ^ quarterClock j - quarterClock j - 1, x, 0] }⊢ Relation.TransGen (BoundedEdge (widthBudget j)) { control := ControlWord.entry 0, regs := [0, 0, f, x, j] } { control := if Algorithm.residual j f = 0 then ControlWord.outside 0 else ControlWord.outside finalHaltId, regs := [0, 0, Algorithm.residual j f - 1, x, 0] } All goals completed! 🐙end ConjectureMachines.Riemann95.Control