Skip to content
Imports
@[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] }
h.succ.zero.succB:ℕ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] }
have hi := ih d (byB:ℕ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⊢ d < d + 1 + 1 omegaAll goals completed! 🐙) 0 (byB:ℕ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⊢ 5 * d + 18 ≤ B omegaAll goals completed! 🐙)h.succ.zero.succB:ℕ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] }
simpa only [Nat.zero_le,Nat.sub_zero,true_and,Nat.zero_sub,hpar]
using hs.trans hiAll goals completed! 🐙
| succ f =>h.succ.succB:ℕ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] }
have hs : Relation.TransGen (BoundedEdge B) ⟨unwind (d+1),[0,0,f+1,x,0]⟩
⟨unwind d,[0,0,f,x,0]⟩ := Relation.TransGen.single
(bounded_unwind_edge B (d+1) (f+1) x hB _ (unwind_succ_positive_step d f x))h.succ.succB:ℕ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] }
have hc : (f+1 ≤ d+1 ∧ (d+1-(f+1))%2 = 0) ↔
(f ≤ d ∧ (d-f)%2 = 0) := byB:ℕ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] }
constructormpB:ℕ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] }⊢ f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 → f ≤ d ∧ (d - f) % 2 = 0mprB:ℕ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] }⊢ f ≤ d ∧ (d - f) % 2 = 0 → f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 <;>mpB:ℕ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] }⊢ f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 → f ≤ d ∧ (d - f) % 2 = 0mprB:ℕ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] }⊢ f ≤ d ∧ (d - f) % 2 = 0 → f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 intro ⟨h1, h2⟩mprB:ℕ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] }h1:f ≤ dh2:(d - f) % 2 = 0⊢ f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 <;>mpB:ℕ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] }h1:f + 1 ≤ d + 1h2:(d + 1 - (f + 1)) % 2 = 0⊢ f ≤ d ∧ (d - f) % 2 = 0mprB:ℕ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] }h1:f ≤ dh2:(d - f) % 2 = 0⊢ f + 1 ≤ d + 1 ∧ (d + 1 - (f + 1)) % 2 = 0 exact ⟨byB:ℕ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] }h1:f ≤ dh2:(d - f) % 2 = 0⊢ f + 1 ≤ d + 1 omegaAll goals completed! 🐙, byB:ℕ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] }h1:f ≤ dh2:(d - f) % 2 = 0⊢ (d + 1 - (f + 1)) % 2 = 0 omegaAll goals completed! 🐙⟩h.succ.succB:ℕ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] }
have hsub : f+1-(d+1+1) = f-(d+1) := byB:ℕ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] } omegah.succ.succB:ℕ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] }
have hite : (if f+1 ≤ d+1 ∧ (d+1-(f+1))%2 = 0 then ControlWord.outside 0
else .outside finalTestId) =
(if f ≤ d ∧ (d-f)%2 = 0 then ControlWord.outside 0
else .outside finalTestId) := byB:ℕ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] }
by_cases hcond : f ≤ d ∧ (d - f) % 2 = 0posB:ℕ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)hcond:f ≤ d ∧ (d - f) % 2 = 0⊢ (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 finalTestIdnegB:ℕ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)hcond:¬(f ≤ d ∧ (d - f) % 2 = 0)⊢ (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
·posB:ℕ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)hcond:f ≤ d ∧ (d - f) % 2 = 0⊢ (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 rw [ite_eq_left (hc.mpr hcond),posB:ℕ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)hcond:f ≤ d ∧ (d - f) % 2 = 0⊢ ControlWord.outside 0 = if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId ite_eq_left hcondposB:ℕ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)hcond:f ≤ d ∧ (d - f) % 2 = 0⊢ ControlWord.outside 0 = ControlWord.outside 0]All goals completed! 🐙
·negB:ℕ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)hcond:¬(f ≤ d ∧ (d - f) % 2 = 0)⊢ (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 rw [ite_eq_right (fun h => hcond (hc.mp h)),negB:ℕ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)hcond:¬(f ≤ d ∧ (d - f) % 2 = 0)⊢ ControlWord.outside finalTestId =
if f ≤ d ∧ (d - f) % 2 = 0 then ControlWord.outside 0 else ControlWord.outside finalTestId ite_eq_right hcondnegB:ℕ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)hcond:¬(f ≤ d ∧ (d - f) % 2 = 0)⊢ ControlWord.outside finalTestId = ControlWord.outside finalTestId]h.succ.succB:ℕ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] }
rw [hite,h.succ.succB:ℕ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 + 1 - (d + 1 + 1), x, 0] } hsubh.succ.succB:ℕ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] }]h.succ.succB:ℕ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 (byB:ℕ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 omegaAll goals completed! 🐙) f (byB:ℕ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 omegaAll 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]⟩ := byJ:ℕ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] }
have hbudget : 19 ≤ widthBudget J := by
unfold widthBudgetJ:ℕq:ℕf:ℕx:ℕhq:q ≤ quarterClock J⊢ 19 ≤ max 16 (10 + 5 * quarterClock J) + 5
have hm := le_max_left 16 (10 + 5 * quarterClock J)J:ℕq:ℕf:ℕx:ℕhq:q ≤ quarterClock Jhm:16 ≤ max 16 (10 + 5 * quarterClock J)⊢ 19 ≤ max 16 (10 + 5 * quarterClock J) + 5
omegaJ:ℕ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] }
have hmax := le_max_right 16 (10 + 5 * quarterClock J)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] }
have test (a : Nat) : Relation.TransGen (BoundedEdge (widthBudget J))
⟨.outside finalTestId,[0,0,a,x,0]⟩
⟨if a = 0 then .outside 0 else .outside finalHaltId,[0,0,a-1,x,0]⟩ :=
Relation.TransGen.single ⟨final_test_step a x,le_trans (outside_frontier_bound _) hbudget⟩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
| zero =>zeroJ:ℕ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] }
have hs : Relation.TransGen (BoundedEdge (widthBudget J)) ⟨.entry 0,[0,0,f,x,0]⟩
⟨.outside finalTestId,[0,0,f,x,0]⟩ := Relation.TransGen.single
⟨byJ:ℕ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⊢ step { control := ControlWord.entry 0, regs := [0, 0, f, x, 0] } =
some { control := ControlWord.outside finalTestId, regs := [0, 0, f, x, 0] } simp [step,entry_zero]All goals completed! 🐙,byJ:ℕ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⊢ List.length (walked { control := ControlWord.entry 0, regs := [0, 0, f, x, 0] }.control) + 3 ≤ widthBudget J rw [entry_frontier_lengthJ:ℕ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⊢ 5 * 0 + 10 ≤ widthBudget J]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⊢ 5 * 0 + 10 ≤ widthBudget J; omegaAll goals completed! 🐙⟩zeroJ:ℕ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] }
simpa only [Nat.sub_zero] using hs.trans (test f)All goals completed! 🐙
| succ d =>succJ:ℕ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] }
have hs : Relation.TransGen (BoundedEdge (widthBudget J))
⟨.entry (d+1),[0,0,f,x,0]⟩ ⟨unwind d,[0,0,f,x,0]⟩ :=
Relation.TransGen.single ⟨byJ:ℕ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⊢ step { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] } =
some { control := unwind d, regs := [0, 0, f, x, 0] } simp [step,entry_succ]All goals completed! 🐙,byJ:ℕ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⊢ List.length (walked { control := ControlWord.entry (d + 1), regs := [0, 0, f, x, 0] }.control) + 3 ≤ widthBudget J
rw [entry_frontier_lengthJ:ℕ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⊢ 5 * (d + 1) + 10 ≤ widthBudget J]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⊢ 5 * (d + 1) + 10 ≤ widthBudget J
unfold widthBudgetJ:ℕ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⊢ 5 * (d + 1) + 10 ≤ max 16 (10 + 5 * quarterClock J) + 5
omegaAll goals completed! 🐙⟩succJ:ℕ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] }
have hlocal : 5 * d + 18 ≤ widthBudget J := byJ:ℕ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] } unfold widthBudgetJ:ℕ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] }⊢ 5 * d + 18 ≤ max 16 (10 + 5 * quarterClock J) + 5; omegasuccJ:ℕ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] }
have hu := hs.trans (bounded_unwind_eval (widthBudget J) d x f hlocal)succJ:ℕ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] }
by_cases hc : f ≤ d ∧ (d-f)%2 = 0posJ:ℕ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] }negJ:ℕ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] }
·posJ:ℕ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] } have hz : f-(d+1) = 0 := byJ:ℕ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] } omegaposJ:ℕ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] }
simpa only [ite_eq_left hc,hz,Nat.zero_sub,ite_true] using huAll goals completed! 🐙
·negJ:ℕ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] } simp only [ite_eq_right hc] at hunegJ:ℕ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] }
exact hu.trans (test (f-(d+1)))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]⟩ := byx:ℕ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] }
have hd := bounded_descent j 0 x j f (byx:ℕj:ℕf:ℕ⊢ 0 + quarterClock j ≤ quarterClock j omegaAll goals completed! 🐙)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] }
simp only [Nat.zero_add] at hdx:ℕ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] }
have hf := (bounded_finish j (quarterClock j) (f/2^quarterClock j) x (byx:ℕ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] }⊢ quarterClock j ≤ quarterClock j omegaAll goals completed! 🐙)).trans_right hdx:ℕ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] }
simpa only [Algorithm.residual_eq] using hfAll goals completed! 🐙end ConjectureMachines.Riemann95.Control