Imports
module public import BusyBeaver.Basic import Mathlib.Tactic.Ring
@[expose] public sectionopen Mathlib Relation Nat Turing BusyBeavernamespace BusyBeaver.PairStack-- ============================================================================ -- Section 1: Tape & List Algebra Helpers -- ============================================================================ variable {Γ Λ : Type*} [Inhabited Γ] [Inhabited Λ]theorem pow_zero_list (u : List (Fin 2)) : u ^ (0 : Nat) = [] := rfltheorem pow_succ_list (u : List (Fin 2)) (n : Nat) : u ^ (n + 1) = u ++ u ^ n := rfltheorem nil_append_list (l : List (Fin 2)) : ([] : List (Fin 2)) ++ l = l := rfltheorem cons_append_list (x : Fin 2) (xs ys : List (Fin 2)) : (x :: xs) ++ ys = x :: (xs ++ ys) := rfltheorem append_nil_list (l : List (Fin 2)) : l ++ [] = l := List.append_nil lattribute [scoped simp] pow_zero_list pow_succ_list nil_append_list cons_append_list append_nil_list listblank_append_nil listblank_append_cons zero_cons_default ListBlank.head_default ListBlank.tail_defaultomit [Inhabited Γ] in theorem list_pow_add (l : List Γ) (n m : Nat) : l^(n + m) = l^n ++ l^m := BusyBeaver.list_pow_add l n mtheorem listblank_append_right_assoc (l₁ l₂ : List Γ) (s : ListBlank Γ) : (l₁ ++ l₂) +> s = l₁ +> (l₂ +> s) := Γ:Type u_1inst✝:Inhabited Γl₁:List Γl₂:List Γs:ListBlank Γ⊢ (l₁ ++ l₂) +> s = l₁ +> l₂ +> s induction l₁ with Γ:Type u_1inst✝:Inhabited Γl₂:List Γs:ListBlank Γ⊢ ([] ++ l₂) +> s = [] +> l₂ +> s All goals completed! 🐙 Γ:Type u_1inst✝:Inhabited Γl₂:List Γs:ListBlank Γx:Γxs:List Γih:(xs ++ l₂) +> s = xs +> l₂ +> s⊢ (x :: xs ++ l₂) +> s = (x :: xs) +> l₂ +> s All goals completed! 🐙theorem listblank_eq_one_cons_tail {Z : ListBlank (Fin 2)} (hZ : Z.head = 1) : Z = (1 : Fin 2) >> Z.tail := Z:ListBlank (Fin 2)hZ:Z.head = 1⊢ Z = 1 >> Z.tail All goals completed! 🐙@[simp] theorem zeros_append_default (n : ℕ) : (([0] : List (Fin 2)) ^ n) +> (default : ListBlank (Fin 2)) = default := n:ℕ⊢ [0] ^ n +> default = default induction n with ⊢ [0] ^ 0 +> default = default All goals completed! 🐙 k:ℕih:[0] ^ k +> default = default⊢ [0] ^ (k + 1) +> default = default All goals completed! 🐙

Increment the primary coordinate of the top stack element (or push (0, 0) if empty).

def bumpHead : List (ℕ × ℕ) → List (ℕ × ℕ) | [] => [(0, 0)] | (a, b) :: L => (a + 1, b) :: L

Increment the primary coordinate of the top stack element n times.

def bumpN : ℕ → List (ℕ × ℕ) → List (ℕ × ℕ) | 0, L => L | n + 1, L => bumpHead (bumpN n L)

Ensure a stack is non-empty by appending (0, 0) if empty.

def ensureNonEmpty : List (ℕ × ℕ) → List (ℕ × ℕ) | [] => [(0, 0)] | p :: R => p :: R@[simp] theorem bumpN_zero (L : List (ℕ × ℕ)) : bumpN 0 L = L := rfl@[simp] theorem bumpN_succ (n : ℕ) (L : List (ℕ × ℕ)) : bumpN (n + 1) L = bumpHead (bumpN n L) := rfltheorem bumpHead_ne_nil (L : List (ℕ × ℕ)) : bumpHead L ≠ [] := L:List (ℕ × ℕ)⊢ bumpHead L ≠ [] ⊢ bumpHead [] ≠ []L':List (ℕ × ℕ)a:ℕb:ℕ⊢ bumpHead ((a, b) :: L') ≠ [] ⊢ bumpHead [] ≠ []L':List (ℕ × ℕ)a:ℕb:ℕ⊢ bumpHead ((a, b) :: L') ≠ [] All goals completed! 🐙theorem bumpN_succ_ne_nil (n : ℕ) (L : List (ℕ × ℕ)) : bumpN (n + 1) L ≠ [] := n:ℕL:List (ℕ × ℕ)⊢ bumpN (n + 1) L ≠ [] n:ℕL:List (ℕ × ℕ)⊢ bumpHead (bumpN n L) ≠ []; All goals completed! 🐙theorem ensureNonEmpty_ne_nil (R : List (ℕ × ℕ)) : ensureNonEmpty R ≠ [] := R:List (ℕ × ℕ)⊢ ensureNonEmpty R ≠ [] ⊢ ensureNonEmpty [] ≠ []p:ℕ × ℕR':List (ℕ × ℕ)⊢ ensureNonEmpty (p :: R') ≠ [] ⊢ ensureNonEmpty [] ≠ []p:ℕ × ℕR':List (ℕ × ℕ)⊢ ensureNonEmpty (p :: R') ≠ [] All goals completed! 🐙

Generic parametric left stack encoding: encLeft ((a, b) :: L) = encLeft L <+ (sSym ^ (sep + b % maxSep)) <+ (dSym ^ (stride * a + offset)).

def encLeftParam (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) : List (ℕ × ℕ) → ListBlank (Fin 2) | [] => default | (a, b) :: L => (encLeftParam dSym sSym stride offset sep maxSep L <+ (([sSym] : List (Fin 2)) ^ (sep + b % maxSep))) <+ (([dSym] : List (Fin 2)) ^ (stride * a + offset))

Generic parametric right stack encoding: encRight ((d, b) :: R) = (dSym ^ (stride * d + offset)) +> ((sSym ^ (sep + b % maxSep)) +> encRight R).

def encRightParam (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) : List (ℕ × ℕ) → ListBlank (Fin 2) | [] => default | (d, b) :: R => (([dSym] : List (Fin 2)) ^ (stride * d + offset)) +> ((([sSym] : List (Fin 2)) ^ (sep + b % maxSep)) +> encRightParam dSym sSym stride offset sep maxSep R)@[simp] theorem encLeftParam_nil (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) : encLeftParam dSym sSym stride offset sep maxSep [] = default := rfl@[simp] theorem encRightParam_nil (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) : encRightParam dSym sSym stride offset sep maxSep [] = default := rfl@[simp] theorem encLeftParam_cons (dSym sSym : Fin 2) (stride offset sep maxSep a b : ℕ) (L : List (ℕ × ℕ)) : encLeftParam dSym sSym stride offset sep maxSep ((a, b) :: L) = (encLeftParam dSym sSym stride offset sep maxSep L <+ (([sSym] : List (Fin 2)) ^ (sep + b % maxSep))) <+ (([dSym] : List (Fin 2)) ^ (stride * a + offset)) := rfl@[simp] theorem encRightParam_cons (dSym sSym : Fin 2) (stride offset sep maxSep d b : ℕ) (R : List (ℕ × ℕ)) : encRightParam dSym sSym stride offset sep maxSep ((d, b) :: R) = (([dSym] : List (Fin 2)) ^ (stride * d + offset)) +> ((([sSym] : List (Fin 2)) ^ (sep + b % maxSep)) +> encRightParam dSym sSym stride offset sep maxSep R) := rfl-- ============================================================================ -- Section 4: Head & Successor Theorems -- ============================================================================ theorem encLeftParam_head (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) (h_offset : offset > 0) (a b : ℕ) (L : List (ℕ × ℕ)) : (encLeftParam dSym sSym stride offset sep maxSep ((a, b) :: L)).head = dSym := dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕh_offset:offset > 0a:ℕb:ℕL:List (ℕ × ℕ)⊢ (encLeftParam dSym sSym stride offset sep maxSep ((a, b) :: L)).head = dSym dSym:Fin 2sSym:Fin 2stride:ℕsep:ℕmaxSep:ℕa:ℕb:ℕL:List (ℕ × ℕ)off':ℕh_offset:off'.succ > 0⊢ (encLeftParam dSym sSym stride off'.succ sep maxSep ((a, b) :: L)).head = dSym dSym:Fin 2sSym:Fin 2stride:ℕsep:ℕmaxSep:ℕa:ℕb:ℕL:List (ℕ × ℕ)off':ℕh_offset:off'.succ > 0⊢ ((dSym :: ([] ++ [dSym] ^ (stride * a + off'))) +> [sSym] ^ (sep + b % maxSep) +> encLeftParam dSym sSym stride off'.succ sep maxSep L).head = dSym All goals completed! 🐙theorem encRightParam_head (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) (h_offset : offset > 0) (d b : ℕ) (R : List (ℕ × ℕ)) : (encRightParam dSym sSym stride offset sep maxSep ((d, b) :: R)).head = dSym := dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕh_offset:offset > 0d:ℕb:ℕR:List (ℕ × ℕ)⊢ (encRightParam dSym sSym stride offset sep maxSep ((d, b) :: R)).head = dSym dSym:Fin 2sSym:Fin 2stride:ℕsep:ℕmaxSep:ℕd:ℕb:ℕR:List (ℕ × ℕ)off':ℕh_offset:off'.succ > 0⊢ (encRightParam dSym sSym stride off'.succ sep maxSep ((d, b) :: R)).head = dSym dSym:Fin 2sSym:Fin 2stride:ℕsep:ℕmaxSep:ℕd:ℕb:ℕR:List (ℕ × ℕ)off':ℕh_offset:off'.succ > 0⊢ ((dSym :: ([] ++ [dSym] ^ (stride * d + off'))) +> [sSym] ^ (sep + b % maxSep) +> encRightParam dSym sSym stride off'.succ sep maxSep R).head = dSym All goals completed! 🐙theorem encLeftParam_succ (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) (a b : ℕ) (L : List (ℕ × ℕ)) : encLeftParam dSym sSym stride offset sep maxSep ((a + 1, b) :: L) = (([dSym] : List (Fin 2)) ^ stride) +> encLeftParam dSym sSym stride offset sep maxSep ((a, b) :: L) := dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕa:ℕb:ℕL:List (ℕ × ℕ)⊢ encLeftParam dSym sSym stride offset sep maxSep ((a + 1, b) :: L) = [dSym] ^ stride +> encLeftParam dSym sSym stride offset sep maxSep ((a, b) :: L) dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕa:ℕb:ℕL:List (ℕ × ℕ)⊢ [dSym] ^ (stride * (a + 1) + offset) +> [sSym] ^ (sep + b % maxSep) +> encLeftParam dSym sSym stride offset sep maxSep L = [dSym] ^ stride +> [dSym] ^ (stride * a + offset) +> [sSym] ^ (sep + b % maxSep) +> encLeftParam dSym sSym stride offset sep maxSep L All goals completed! 🐙theorem encRightParam_succ (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) (d b : ℕ) (R : List (ℕ × ℕ)) : encRightParam dSym sSym stride offset sep maxSep ((d + 1, b) :: R) = (([dSym] : List (Fin 2)) ^ stride) +> encRightParam dSym sSym stride offset sep maxSep ((d, b) :: R) := dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕd:ℕb:ℕR:List (ℕ × ℕ)⊢ encRightParam dSym sSym stride offset sep maxSep ((d + 1, b) :: R) = [dSym] ^ stride +> encRightParam dSym sSym stride offset sep maxSep ((d, b) :: R) dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕd:ℕb:ℕR:List (ℕ × ℕ)⊢ [dSym] ^ (stride * (d + 1) + offset) +> [sSym] ^ (sep + b % maxSep) +> encRightParam dSym sSym stride offset sep maxSep R = [dSym] ^ stride +> [dSym] ^ (stride * d + offset) +> [sSym] ^ (sep + b % maxSep) +> encRightParam dSym sSym stride offset sep maxSep R All goals completed! 🐙theorem encLeftParam_cons_dSym (dSym : Fin 2) (sep maxSep : ℕ) (L : List (ℕ × ℕ)) : dSym >> encLeftParam dSym 0 1 1 sep maxSep L = encLeftParam dSym 0 1 1 sep maxSep (bumpHead L) := dSym:Fin 2sep:ℕmaxSep:ℕL:List (ℕ × ℕ)⊢ dSym >> encLeftParam dSym 0 1 1 sep maxSep L = encLeftParam dSym 0 1 1 sep maxSep (bumpHead L) dSym:Fin 2sep:ℕmaxSep:ℕ⊢ dSym >> encLeftParam dSym 0 1 1 sep maxSep [] = encLeftParam dSym 0 1 1 sep maxSep (bumpHead [])dSym:Fin 2sep:ℕmaxSep:ℕL':List (ℕ × ℕ)a:ℕb:ℕ⊢ dSym >> encLeftParam dSym 0 1 1 sep maxSep ((a, b) :: L') = encLeftParam dSym 0 1 1 sep maxSep (bumpHead ((a, b) :: L')) dSym:Fin 2sep:ℕmaxSep:ℕ⊢ dSym >> encLeftParam dSym 0 1 1 sep maxSep [] = encLeftParam dSym 0 1 1 sep maxSep (bumpHead []) All goals completed! 🐙 dSym:Fin 2sep:ℕmaxSep:ℕL':List (ℕ × ℕ)a:ℕb:ℕ⊢ dSym >> encLeftParam dSym 0 1 1 sep maxSep ((a, b) :: L') = encLeftParam dSym 0 1 1 sep maxSep (bumpHead ((a, b) :: L')) dSym:Fin 2sep:ℕmaxSep:ℕL':List (ℕ × ℕ)a:ℕb:ℕh:encLeftParam dSym 0 1 1 sep maxSep ((a + 1, b) :: L') = [dSym] ^ 1 +> encLeftParam dSym 0 1 1 sep maxSep ((a, b) :: L')⊢ dSym >> encLeftParam dSym 0 1 1 sep maxSep ((a, b) :: L') = encLeftParam dSym 0 1 1 sep maxSep (bumpHead ((a, b) :: L')) dSym:Fin 2sep:ℕmaxSep:ℕL':List (ℕ × ℕ)a:ℕb:ℕh:encLeftParam dSym 0 1 1 sep maxSep ((a + 1, b) :: L') = dSym >> encLeftParam dSym 0 1 1 sep maxSep ((a, b) :: L')⊢ dSym >> encLeftParam dSym 0 1 1 sep maxSep ((a, b) :: L') = encLeftParam dSym 0 1 1 sep maxSep (bumpHead ((a, b) :: L')) All goals completed! 🐙theorem encRightParam_cons_dSym (dSym : Fin 2) (sep maxSep : ℕ) (R : List (ℕ × ℕ)) : dSym >> encRightParam dSym 0 1 1 sep maxSep R = encRightParam dSym 0 1 1 sep maxSep (bumpHead R) := dSym:Fin 2sep:ℕmaxSep:ℕR:List (ℕ × ℕ)⊢ dSym >> encRightParam dSym 0 1 1 sep maxSep R = encRightParam dSym 0 1 1 sep maxSep (bumpHead R) dSym:Fin 2sep:ℕmaxSep:ℕ⊢ dSym >> encRightParam dSym 0 1 1 sep maxSep [] = encRightParam dSym 0 1 1 sep maxSep (bumpHead [])dSym:Fin 2sep:ℕmaxSep:ℕR':List (ℕ × ℕ)d:ℕb:ℕ⊢ dSym >> encRightParam dSym 0 1 1 sep maxSep ((d, b) :: R') = encRightParam dSym 0 1 1 sep maxSep (bumpHead ((d, b) :: R')) dSym:Fin 2sep:ℕmaxSep:ℕ⊢ dSym >> encRightParam dSym 0 1 1 sep maxSep [] = encRightParam dSym 0 1 1 sep maxSep (bumpHead []) All goals completed! 🐙 dSym:Fin 2sep:ℕmaxSep:ℕR':List (ℕ × ℕ)d:ℕb:ℕ⊢ dSym >> encRightParam dSym 0 1 1 sep maxSep ((d, b) :: R') = encRightParam dSym 0 1 1 sep maxSep (bumpHead ((d, b) :: R')) dSym:Fin 2sep:ℕmaxSep:ℕR':List (ℕ × ℕ)d:ℕb:ℕh:encRightParam dSym 0 1 1 sep maxSep ((d + 1, b) :: R') = [dSym] ^ 1 +> encRightParam dSym 0 1 1 sep maxSep ((d, b) :: R')⊢ dSym >> encRightParam dSym 0 1 1 sep maxSep ((d, b) :: R') = encRightParam dSym 0 1 1 sep maxSep (bumpHead ((d, b) :: R')) dSym:Fin 2sep:ℕmaxSep:ℕR':List (ℕ × ℕ)d:ℕb:ℕh:encRightParam dSym 0 1 1 sep maxSep ((d + 1, b) :: R') = dSym >> encRightParam dSym 0 1 1 sep maxSep ((d, b) :: R')⊢ dSym >> encRightParam dSym 0 1 1 sep maxSep ((d, b) :: R') = encRightParam dSym 0 1 1 sep maxSep (bumpHead ((d, b) :: R')) All goals completed! 🐙theorem encLeftParam_bumpN (dSym : Fin 2) (sep maxSep : ℕ) (n : ℕ) (L : List (ℕ × ℕ)) : (([dSym] : List (Fin 2)) ^ n) +> encLeftParam dSym 0 1 1 sep maxSep L = encLeftParam dSym 0 1 1 sep maxSep (bumpN n L) := dSym:Fin 2sep:ℕmaxSep:ℕn:ℕL:List (ℕ × ℕ)⊢ [dSym] ^ n +> encLeftParam dSym 0 1 1 sep maxSep L = encLeftParam dSym 0 1 1 sep maxSep (bumpN n L) induction n with dSym:Fin 2sep:ℕmaxSep:ℕL:List (ℕ × ℕ)⊢ [dSym] ^ 0 +> encLeftParam dSym 0 1 1 sep maxSep L = encLeftParam dSym 0 1 1 sep maxSep (bumpN 0 L) All goals completed! 🐙 dSym:Fin 2sep:ℕmaxSep:ℕL:List (ℕ × ℕ)k:ℕih:[dSym] ^ k +> encLeftParam dSym 0 1 1 sep maxSep L = encLeftParam dSym 0 1 1 sep maxSep (bumpN k L)⊢ [dSym] ^ (k + 1) +> encLeftParam dSym 0 1 1 sep maxSep L = encLeftParam dSym 0 1 1 sep maxSep (bumpN (k + 1) L) All goals completed! 🐙theorem encRightParam_bumpN (dSym : Fin 2) (sep maxSep : ℕ) (n : ℕ) (R : List (ℕ × ℕ)) : (([dSym] : List (Fin 2)) ^ n) +> encRightParam dSym 0 1 1 sep maxSep R = encRightParam dSym 0 1 1 sep maxSep (bumpN n R) := dSym:Fin 2sep:ℕmaxSep:ℕn:ℕR:List (ℕ × ℕ)⊢ [dSym] ^ n +> encRightParam dSym 0 1 1 sep maxSep R = encRightParam dSym 0 1 1 sep maxSep (bumpN n R) induction n with dSym:Fin 2sep:ℕmaxSep:ℕR:List (ℕ × ℕ)⊢ [dSym] ^ 0 +> encRightParam dSym 0 1 1 sep maxSep R = encRightParam dSym 0 1 1 sep maxSep (bumpN 0 R) All goals completed! 🐙 dSym:Fin 2sep:ℕmaxSep:ℕR:List (ℕ × ℕ)k:ℕih:[dSym] ^ k +> encRightParam dSym 0 1 1 sep maxSep R = encRightParam dSym 0 1 1 sep maxSep (bumpN k R)⊢ [dSym] ^ (k + 1) +> encRightParam dSym 0 1 1 sep maxSep R = encRightParam dSym 0 1 1 sep maxSep (bumpN (k + 1) R) All goals completed! 🐙-- ============================================================================ -- Section 5: Modulo & Canonical Shorthands -- ============================================================================ theorem mod2_cases (b : ℕ) : b % 2 = 0 ∨ b % 2 = 1 := b:ℕ⊢ b % 2 = 0 ∨ b % 2 = 1 All goals completed! 🐙theorem mod3_cases (b : ℕ) : b % 3 = 0 ∨ b % 3 = 1 ∨ b % 3 = 2 := b:ℕ⊢ b % 3 = 0 ∨ b % 3 = 1 ∨ b % 3 = 2 All goals completed! 🐙theorem mod4_cases (b : ℕ) : b % 4 = 0 ∨ b % 4 = 1 ∨ b % 4 = 2 ∨ b % 4 = 3 := b:ℕ⊢ b % 4 = 0 ∨ b % 4 = 1 ∨ b % 4 = 2 ∨ b % 4 = 3 All goals completed! 🐙theorem encLeftParam_mod (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) (a b : ℕ) (L : List (ℕ × ℕ)) : encLeftParam dSym sSym stride offset sep maxSep ((a, b) :: L) = encLeftParam dSym sSym stride offset sep maxSep ((a, b % maxSep) :: L) := dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕa:ℕb:ℕL:List (ℕ × ℕ)⊢ encLeftParam dSym sSym stride offset sep maxSep ((a, b) :: L) = encLeftParam dSym sSym stride offset sep maxSep ((a, b % maxSep) :: L) All goals completed! 🐙theorem encRightParam_mod (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) (d b : ℕ) (R : List (ℕ × ℕ)) : encRightParam dSym sSym stride offset sep maxSep ((d, b) :: R) = encRightParam dSym sSym stride offset sep maxSep ((d, b % maxSep) :: R) := dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕd:ℕb:ℕR:List (ℕ × ℕ)⊢ encRightParam dSym sSym stride offset sep maxSep ((d, b) :: R) = encRightParam dSym sSym stride offset sep maxSep ((d, b % maxSep) :: R) All goals completed! 🐙

Normalize a stack by reducing second coordinates modulo maxSep.

def normStack (maxSep : ℕ) : List (ℕ × ℕ) → List (ℕ × ℕ) := List.map (fun p => (p.1, p.2 % maxSep))

Predicate: every element's secondary coordinate is strictly bounded by maxSep.

def AllSep (maxSep : ℕ) (L : List (ℕ × ℕ)) : Prop := ∀ p ∈ L, p.2 < maxSeptheorem encLeftParam_norm (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) (L : List (ℕ × ℕ)) : encLeftParam dSym sSym stride offset sep maxSep (normStack maxSep L) = encLeftParam dSym sSym stride offset sep maxSep L := dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕL:List (ℕ × ℕ)⊢ encLeftParam dSym sSym stride offset sep maxSep (normStack maxSep L) = encLeftParam dSym sSym stride offset sep maxSep L induction L with dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕ⊢ encLeftParam dSym sSym stride offset sep maxSep (normStack maxSep []) = encLeftParam dSym sSym stride offset sep maxSep [] All goals completed! 🐙 dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕp:ℕ × ℕL':List (ℕ × ℕ)ih:encLeftParam dSym sSym stride offset sep maxSep (normStack maxSep L') = encLeftParam dSym sSym stride offset sep maxSep L'⊢ encLeftParam dSym sSym stride offset sep maxSep (normStack maxSep (p :: L')) = encLeftParam dSym sSym stride offset sep maxSep (p :: L') dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕL':List (ℕ × ℕ)ih:encLeftParam dSym sSym stride offset sep maxSep (normStack maxSep L') = encLeftParam dSym sSym stride offset sep maxSep L'a:ℕb:ℕ⊢ encLeftParam dSym sSym stride offset sep maxSep (normStack maxSep ((a, b) :: L')) = encLeftParam dSym sSym stride offset sep maxSep ((a, b) :: L') dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕL':List (ℕ × ℕ)ih:encLeftParam dSym sSym stride offset sep maxSep (normStack maxSep L') = encLeftParam dSym sSym stride offset sep maxSep L'a:ℕb:ℕ⊢ encLeftParam dSym sSym stride offset sep maxSep ((a, b % maxSep) :: normStack maxSep L') = encLeftParam dSym sSym stride offset sep maxSep ((a, b) :: L') All goals completed! 🐙theorem encRightParam_norm (dSym sSym : Fin 2) (stride offset sep maxSep : ℕ) (R : List (ℕ × ℕ)) : encRightParam dSym sSym stride offset sep maxSep (normStack maxSep R) = encRightParam dSym sSym stride offset sep maxSep R := dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕR:List (ℕ × ℕ)⊢ encRightParam dSym sSym stride offset sep maxSep (normStack maxSep R) = encRightParam dSym sSym stride offset sep maxSep R induction R with dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕ⊢ encRightParam dSym sSym stride offset sep maxSep (normStack maxSep []) = encRightParam dSym sSym stride offset sep maxSep [] All goals completed! 🐙 dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕp:ℕ × ℕR':List (ℕ × ℕ)ih:encRightParam dSym sSym stride offset sep maxSep (normStack maxSep R') = encRightParam dSym sSym stride offset sep maxSep R'⊢ encRightParam dSym sSym stride offset sep maxSep (normStack maxSep (p :: R')) = encRightParam dSym sSym stride offset sep maxSep (p :: R') dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕR':List (ℕ × ℕ)ih:encRightParam dSym sSym stride offset sep maxSep (normStack maxSep R') = encRightParam dSym sSym stride offset sep maxSep R'd:ℕb:ℕ⊢ encRightParam dSym sSym stride offset sep maxSep (normStack maxSep ((d, b) :: R')) = encRightParam dSym sSym stride offset sep maxSep ((d, b) :: R') dSym:Fin 2sSym:Fin 2stride:ℕoffset:ℕsep:ℕmaxSep:ℕR':List (ℕ × ℕ)ih:encRightParam dSym sSym stride offset sep maxSep (normStack maxSep R') = encRightParam dSym sSym stride offset sep maxSep R'd:ℕb:ℕ⊢ encRightParam dSym sSym stride offset sep maxSep ((d, b % maxSep) :: normStack maxSep R') = encRightParam dSym sSym stride offset sep maxSep ((d, b) :: R') All goals completed! 🐙theorem allSep_normStack (maxSep : ℕ) (h_pos : maxSep > 0) (L : List (ℕ × ℕ)) : AllSep maxSep (normStack maxSep L) := maxSep:ℕh_pos:maxSep > 0L:List (ℕ × ℕ)⊢ AllSep maxSep (normStack maxSep L) maxSep:ℕh_pos:maxSep > 0L:List (ℕ × ℕ)p:ℕ × ℕhp:p ∈ normStack maxSep L⊢ p.2 < maxSep maxSep:ℕh_pos:maxSep > 0L:List (ℕ × ℕ)q:ℕ × ℕleft✝:q ∈ Lhp:(q.1, q.2 % maxSep) ∈ normStack maxSep L⊢ (q.1, q.2 % maxSep).2 < maxSep All goals completed! 🐙-- ============================================================================ -- Section 7: View Combinators -- ============================================================================ theorem applyView_id_nil (s : ListBlank Γ) : applyView (.id []) s = s := rfltheorem applyView_id_cons (x : Γ) (xs : List Γ) (s : ListBlank Γ) : applyView (.id (x :: xs)) s = (x :: xs) +> s := rfltheorem applyView_tail_nil (s : ListBlank Γ) : applyView (.tail []) s = s.tail := rfltheorem applyView_tail_cons (x : Γ) (xs : List Γ) (s : ListBlank Γ) : applyView (.tail (x :: xs)) s = (x :: xs) +> s.tail := rfltheorem applyView_tail_one (enc : List (ℕ × ℕ) → ListBlank (Fin 2)) (h_head : ∀ d b R, (enc ((d, b) :: R)).head = 1) (h_nil : applyView (.tail [1]) (enc []) = enc (ensureNonEmpty [])) (R : List (ℕ × ℕ)) : applyView (.tail [1]) (enc R) = enc (ensureNonEmpty R) := enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1]) (enc []) = enc (ensureNonEmpty [])R:List (ℕ × ℕ)⊢ applyView (HalfTapeView.tail [1]) (enc R) = enc (ensureNonEmpty R) enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1]) (enc []) = enc (ensureNonEmpty [])⊢ applyView (HalfTapeView.tail [1]) (enc []) = enc (ensureNonEmpty [])enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1]) (enc []) = enc (ensureNonEmpty [])R':List (ℕ × ℕ)d:ℕb:ℕ⊢ applyView (HalfTapeView.tail [1]) (enc ((d, b) :: R')) = enc (ensureNonEmpty ((d, b) :: R')) enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1]) (enc []) = enc (ensureNonEmpty [])⊢ applyView (HalfTapeView.tail [1]) (enc []) = enc (ensureNonEmpty []) All goals completed! 🐙 enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1]) (enc []) = enc (ensureNonEmpty [])R':List (ℕ × ℕ)d:ℕb:ℕ⊢ applyView (HalfTapeView.tail [1]) (enc ((d, b) :: R')) = enc (ensureNonEmpty ((d, b) :: R')) enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1]) (enc []) = enc (ensureNonEmpty [])R':List (ℕ × ℕ)d:ℕb:ℕ⊢ 1 >> (enc ((d, b) :: R')).tail = enc ((d, b) :: R') All goals completed! 🐙theorem applyView_tail_zero_one (enc : List (ℕ × ℕ) → ListBlank (Fin 2)) (h_head : ∀ d b R, (enc ((d, b) :: R)).head = 1) (h_nil : applyView (.tail [0, 1]) (enc []) = (0 : Fin 2) >> enc (ensureNonEmpty [])) (R : List (ℕ × ℕ)) : applyView (.tail [0, 1]) (enc R) = (0 : Fin 2) >> enc (ensureNonEmpty R) := enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [0, 1]) (enc []) = 0 >> enc (ensureNonEmpty [])R:List (ℕ × ℕ)⊢ applyView (HalfTapeView.tail [0, 1]) (enc R) = 0 >> enc (ensureNonEmpty R) enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [0, 1]) (enc []) = 0 >> enc (ensureNonEmpty [])⊢ applyView (HalfTapeView.tail [0, 1]) (enc []) = 0 >> enc (ensureNonEmpty [])enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [0, 1]) (enc []) = 0 >> enc (ensureNonEmpty [])R':List (ℕ × ℕ)d:ℕb:ℕ⊢ applyView (HalfTapeView.tail [0, 1]) (enc ((d, b) :: R')) = 0 >> enc (ensureNonEmpty ((d, b) :: R')) enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [0, 1]) (enc []) = 0 >> enc (ensureNonEmpty [])⊢ applyView (HalfTapeView.tail [0, 1]) (enc []) = 0 >> enc (ensureNonEmpty []) All goals completed! 🐙 enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [0, 1]) (enc []) = 0 >> enc (ensureNonEmpty [])R':List (ℕ × ℕ)d:ℕb:ℕ⊢ applyView (HalfTapeView.tail [0, 1]) (enc ((d, b) :: R')) = 0 >> enc (ensureNonEmpty ((d, b) :: R')) enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [0, 1]) (enc []) = 0 >> enc (ensureNonEmpty [])R':List (ℕ × ℕ)d:ℕb:ℕ⊢ 0 >> 1 >> (enc ((d, b) :: R')).tail = 0 >> enc ((d, b) :: R') All goals completed! 🐙theorem applyView_tail_one_one (enc : List (ℕ × ℕ) → ListBlank (Fin 2)) (h_head : ∀ d b R, (enc ((d, b) :: R)).head = 1) (h_nil : applyView (.tail [1, 1]) (enc []) = (1 : Fin 2) >> enc (ensureNonEmpty [])) (R : List (ℕ × ℕ)) : applyView (.tail [1, 1]) (enc R) = (1 : Fin 2) >> enc (ensureNonEmpty R) := enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1, 1]) (enc []) = 1 >> enc (ensureNonEmpty [])R:List (ℕ × ℕ)⊢ applyView (HalfTapeView.tail [1, 1]) (enc R) = 1 >> enc (ensureNonEmpty R) enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1, 1]) (enc []) = 1 >> enc (ensureNonEmpty [])⊢ applyView (HalfTapeView.tail [1, 1]) (enc []) = 1 >> enc (ensureNonEmpty [])enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1, 1]) (enc []) = 1 >> enc (ensureNonEmpty [])R':List (ℕ × ℕ)d:ℕb:ℕ⊢ applyView (HalfTapeView.tail [1, 1]) (enc ((d, b) :: R')) = 1 >> enc (ensureNonEmpty ((d, b) :: R')) enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1, 1]) (enc []) = 1 >> enc (ensureNonEmpty [])⊢ applyView (HalfTapeView.tail [1, 1]) (enc []) = 1 >> enc (ensureNonEmpty []) All goals completed! 🐙 enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1, 1]) (enc []) = 1 >> enc (ensureNonEmpty [])R':List (ℕ × ℕ)d:ℕb:ℕ⊢ applyView (HalfTapeView.tail [1, 1]) (enc ((d, b) :: R')) = 1 >> enc (ensureNonEmpty ((d, b) :: R')) enc:List (ℕ × ℕ) → ListBlank (Fin 2)h_head:∀ (d b : ℕ) (R : List (ℕ × ℕ)), (enc ((d, b) :: R)).head = 1h_nil:applyView (HalfTapeView.tail [1, 1]) (enc []) = 1 >> enc (ensureNonEmpty [])R':List (ℕ × ℕ)d:ℕb:ℕ⊢ 1 >> 1 >> (enc ((d, b) :: R')).tail = 1 >> enc ((d, b) :: R') All goals completed! 🐙-- ============================================================================ -- Section 8: Block Encoding Audit Helper -- ============================================================================ theorem blockEncodingParam (strideL offsetL sepL maxSepL strideR offsetR sepR maxSepR : ℕ) (h_sL : strideL > 0) (h_oL : offsetL > 0) (h_sepL : sepL > 0) (h_m1L : 1 ≤ maxSepL) (h_m2L : maxSepL ≤ 4) (h_sR : strideR > 0) (h_oR : offsetR > 0) (h_sepR : sepR > 0) (h_m1R : 1 ≤ maxSepR) (h_m2R : maxSepR ≤ 4) (dSym sSym : Fin 2) : ∃ strideL' offsetL' sepL' maxSepL' strideR' offsetR' sepR' maxSepR' : ℕ, strideL' > 0 ∧ offsetL' > 0 ∧ sepL' > 0 ∧ 1 ≤ maxSepL' ∧ maxSepL' ≤ 4 ∧ strideR' > 0 ∧ offsetR' > 0 ∧ sepR' > 0 ∧ 1 ≤ maxSepR' ∧ maxSepR' ≤ 4 ∧ (∀ a (b : StackTuple 1) L, encLeftParam dSym sSym strideL offsetL sepL maxSepL ((a, b) :: L) = (encLeftParam dSym sSym strideL offsetL sepL maxSepL L <+ (([sSym] : List (Fin 2)) ^ (stackSepLen sepL' maxSepL' b))) <+ (([dSym] : List (Fin 2)) ^ (strideL' * a + offsetL'))) ∧ (∀ d (b : StackTuple 1) R, encRightParam dSym sSym strideR offsetR sepR maxSepR ((d, b) :: R) = (([dSym] : List (Fin 2)) ^ (strideR' * d + offsetR')) +> ((([sSym] : List (Fin 2)) ^ (stackSepLen sepR' maxSepR' b)) +> encRightParam dSym sSym strideR offsetR sepR maxSepR R)) := ⟨strideL, offsetL, sepL, maxSepL, strideR, offsetR, sepR, maxSepR, h_sL, h_oL, h_sepL, h_m1L, h_m2L, h_sR, h_oR, h_sepR, h_m1R, h_m2R, fun _ _ _ => rfl, fun _ _ _ => rfl⟩

Lift a 1-digit stack List ℕ to a 2-digit stack List (ℕ × ℕ) by appending 0 second components.

def liftPairList : List ℕ → List (ℕ × ℕ) | [] => [] | x :: xs => (x, 0) :: liftPairList xs@[simp] theorem map_fst_liftPairList : ∀ L1 : List ℕ, (liftPairList L1).map Prod.fst = L1 | [] => rfl | _ :: xs => congrArg (_ :: ·) (map_fst_liftPairList xs)

Canonical proposition package for 1-digit stack cryptids on 2-symbol machines (Fin 2).

def OneDigitStackCryptidProp {Λ : Type*} [Inhabited Λ] (target_tm : Machine (Fin 2) Λ) (StackMode : Type) (encLeft1 encRight1 : List ℕ → ListBlank (Fin 2)) (evalStackCfg1 : StackMode → List ℕ → List ℕ → Cfg (Fin 2) Λ) (IsInStackSystem1 : Cfg (Fin 2) Λ → Prop) : Prop := encLeft1 [] = default ∧ encRight1 [] = default ∧ (∀ a L, (encLeft1 (a :: L)).head = (1 : Fin 2)) ∧ (∀ d R, (encRight1 (d :: R)).head = (1 : Fin 2)) ∧ (∃ t : ListBlank (Fin 2), t.head = (1 : Fin 2) ∧ ∀ L : List ℕ, encLeft1 L ≠ t) ∧ (∃ t : ListBlank (Fin 2), t.head = (1 : Fin 2) ∧ ∀ R : List ℕ, encRight1 R ≠ t) ∧ (∃ strideL offsetL sepL strideR offsetR sepR : ℕ, strideL > 0 ∧ offsetL > 0 ∧ sepL > 0 ∧ strideR > 0 ∧ offsetR > 0 ∧ sepR > 0 ∧ (∀ a L, encLeft1 (a :: L) = (encLeft1 L <+ (([0] : List (Fin 2)) ^ sepL)) <+ (([1] : List (Fin 2)) ^ (strideL * a + offsetL))) ∧ (∀ d R, encRight1 (d :: R) = (([1] : List (Fin 2)) ^ (strideR * d + offsetR)) +> ((([0] : List (Fin 2)) ^ sepR) +> encRight1 R))) ∧ (∃ modes : List StackMode, modes.length ≤ 6 ∧ ∀ m : StackMode, m ∈ modes) ∧ IsValidStackModes encLeft1 encRight1 evalStackCfg1 ∧ (∀ cfg, IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L R) ∧ (∀ m L R, IsInStackSystem1 (evalStackCfg1 m L R)) ∧ (∃ cfg₀, ((init []) [target_tm]⊢⁺ cfg₀) ∧ IsInStackSystem1 cfg₀) ∧ (∀ cfg, IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone))

Universal lift theorem from 1-digit stack cryptid to 2-digit IsStackCryptid.

theorem lift_one_digit_prop {Λ : Type*} [Inhabited Λ] (target_tm : Machine (Fin 2) Λ) (StackMode : Type) (encLeft1 encRight1 : List ℕ → ListBlank (Fin 2)) (evalStackCfg1 : StackMode → List ℕ → List ℕ → Cfg (Fin 2) Λ) (IsInStackSystem1 : Cfg (Fin 2) Λ → Prop) (h : OneDigitStackCryptidProp target_tm StackMode encLeft1 encRight1 evalStackCfg1 IsInStackSystem1) : IsStackCryptid target_tm := Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → Proph:OneDigitStackCryptidProp target_tm StackMode encLeft1 encRight1 evalStackCfg1 IsInStackSystem1⊢ IsStackCryptid target_tm Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → Proph:OneDigitStackCryptidProp target_tm StackMode encLeft1 encRight1 evalStackCfg1 IsInStackSystem1⊢ IsValidStackPolarity 1 0 ∧ (fun L ↦ encLeft1 (List.map Prod.fst L)) [] = default ∧ (fun R ↦ encRight1 (List.map Prod.fst R)) [] = default ∧ (∀ (a : ℕ) (b : rec ℕ (fun x ih ↦ ℕ × ih) 0) (L : List (StackTuple (0 + 2))), ((fun L ↦ encLeft1 (List.map Prod.fst L)) ((a, b) :: L)).head = 1) ∧ (∀ (d : ℕ) (b : rec ℕ (fun x ih ↦ ℕ × ih) 0) (R : List (StackTuple (0 + 2))), ((fun R ↦ encRight1 (List.map Prod.fst R)) ((d, b) :: R)).head = 1) ∧ (∃ t, t.head = 1 ∧ ∀ (L : List (StackTuple (0 + 2))), (fun L ↦ encLeft1 (List.map Prod.fst L)) L ≠ t) ∧ (∃ t, t.head = 1 ∧ ∀ (R : List (StackTuple (0 + 2))), (fun R ↦ encRight1 (List.map Prod.fst R)) R ≠ t) ∧ (∃ strideL offsetL sepL maxSepL strideR offsetR sepR maxSepR, strideL > 0 ∧ offsetL > 0 ∧ sepL > 0 ∧ 1 ≤ maxSepL ∧ maxSepL ≤ 4 ∧ strideR > 0 ∧ offsetR > 0 ∧ sepR > 0 ∧ 1 ≤ maxSepR ∧ maxSepR ≤ 4 ∧ (∀ (a : ℕ) (b : rec ℕ (fun x ih ↦ ℕ × ih) 0) (L : List (StackTuple (0 + 2))), (fun L ↦ encLeft1 (List.map Prod.fst L)) ((a, b) :: L) = [1] ^ (strideL * a + offsetL) +> [0] ^ stackSepLen sepL maxSepL b +> (fun L ↦ encLeft1 (List.map Prod.fst L)) L) ∧ ∀ (d : ℕ) (b : rec ℕ (fun x ih ↦ ℕ × ih) 0) (R : List (StackTuple (0 + 2))), (fun R ↦ encRight1 (List.map Prod.fst R)) ((d, b) :: R) = [1] ^ (strideR * d + offsetR) +> [0] ^ stackSepLen sepR maxSepR b +> (fun R ↦ encRight1 (List.map Prod.fst R)) R) ∧ (∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modes) ∧ (IsValidStackModes (fun L ↦ encLeft1 (List.map Prod.fst L)) (fun R ↦ encRight1 (List.map Prod.fst R)) fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) ∧ (∀ (cfg : Cfg (Fin (0 + 2)) Λ), (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg ↔ ∃ m L R, cfg = (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R) ∧ (∀ (m : StackMode) (L R : List (StackTuple (0 + 2))), (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) ((fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R)) ∧ (∃ cfg₀, (init [] [target_tm]⊢⁺ cfg₀) ∧ (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg₀) ∧ ∀ (cfg : Cfg (Fin (0 + 2)) Λ), (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ ((fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg' ∨ (step target_tm cfg').isNone = true) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀⊢ IsValidStackPolarity 1 0 ∧ (fun L ↦ encLeft1 (List.map Prod.fst L)) [] = default ∧ (fun R ↦ encRight1 (List.map Prod.fst R)) [] = default ∧ (∀ (a : ℕ) (b : rec ℕ (fun x ih ↦ ℕ × ih) 0) (L : List (StackTuple (0 + 2))), ((fun L ↦ encLeft1 (List.map Prod.fst L)) ((a, b) :: L)).head = 1) ∧ (∀ (d : ℕ) (b : rec ℕ (fun x ih ↦ ℕ × ih) 0) (R : List (StackTuple (0 + 2))), ((fun R ↦ encRight1 (List.map Prod.fst R)) ((d, b) :: R)).head = 1) ∧ (∃ t, t.head = 1 ∧ ∀ (L : List (StackTuple (0 + 2))), (fun L ↦ encLeft1 (List.map Prod.fst L)) L ≠ t) ∧ (∃ t, t.head = 1 ∧ ∀ (R : List (StackTuple (0 + 2))), (fun R ↦ encRight1 (List.map Prod.fst R)) R ≠ t) ∧ (∃ strideL offsetL sepL maxSepL strideR offsetR sepR maxSepR, strideL > 0 ∧ offsetL > 0 ∧ sepL > 0 ∧ 1 ≤ maxSepL ∧ maxSepL ≤ 4 ∧ strideR > 0 ∧ offsetR > 0 ∧ sepR > 0 ∧ 1 ≤ maxSepR ∧ maxSepR ≤ 4 ∧ (∀ (a : ℕ) (b : rec ℕ (fun x ih ↦ ℕ × ih) 0) (L : List (StackTuple (0 + 2))), (fun L ↦ encLeft1 (List.map Prod.fst L)) ((a, b) :: L) = [1] ^ (strideL * a + offsetL) +> [0] ^ stackSepLen sepL maxSepL b +> (fun L ↦ encLeft1 (List.map Prod.fst L)) L) ∧ ∀ (d : ℕ) (b : rec ℕ (fun x ih ↦ ℕ × ih) 0) (R : List (StackTuple (0 + 2))), (fun R ↦ encRight1 (List.map Prod.fst R)) ((d, b) :: R) = [1] ^ (strideR * d + offsetR) +> [0] ^ stackSepLen sepR maxSepR b +> (fun R ↦ encRight1 (List.map Prod.fst R)) R) ∧ (∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modes) ∧ (IsValidStackModes (fun L ↦ encLeft1 (List.map Prod.fst L)) (fun R ↦ encRight1 (List.map Prod.fst R)) fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) ∧ (∀ (cfg : Cfg (Fin (0 + 2)) Λ), (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg ↔ ∃ m L R, cfg = (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R) ∧ (∀ (m : StackMode) (L R : List (StackTuple (0 + 2))), (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) ((fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R)) ∧ (∃ cfg₀, (init [] [target_tm]⊢⁺ cfg₀) ∧ (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg₀) ∧ ∀ (cfg : Cfg (Fin (0 + 2)) Λ), (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ ((fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg' ∨ (step target_tm cfg').isNone = true) refine ⟨Or.inl ⟨rfl, rfl⟩, hnilL, hnilR, fun a _ L => hheadL a (L.map Prod.fst), fun d _ R => hheadR d (R.map Prod.fst), ⟨tL, htL, fun L => hnsL (L.map Prod.fst)⟩, ⟨tR, htR, fun R => hnsR (R.map Prod.fst)⟩, ⟨sL, oL, sepL, 1, sR, oR, sepR, 1, hsL, hoL, hsepL, le_refl 1, Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀⊢ 1 ≤ 4 All goals completed! 🐙, hsR, hoR, hsepR, le_refl 1, Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀⊢ 1 ≤ 4 All goals completed! 🐙, fun a b L => Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀a:ℕb:rec ℕ (fun x ih ↦ ℕ × ih) 0L:List (StackTuple (0 + 2))⊢ (fun L ↦ encLeft1 (List.map Prod.fst L)) ((a, b) :: L) = [1] ^ (sL * a + oL) +> [0] ^ stackSepLen sepL 1 b +> (fun L ↦ encLeft1 (List.map Prod.fst L)) L All goals completed! 🐙, fun d b R => Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀d:ℕb:rec ℕ (fun x ih ↦ ℕ × ih) 0R:List (StackTuple (0 + 2))⊢ (fun R ↦ encRight1 (List.map Prod.fst R)) ((d, b) :: R) = [1] ^ (sR * d + oR) +> [0] ^ stackSepLen sepR 1 b +> (fun R ↦ encRight1 (List.map Prod.fst R)) R All goals completed! 🐙⟩, hmodes, fun m => ?_, fun _ => Iff.rfl, fun m L R => ⟨m, L, R, rfl⟩, ?_, ?_⟩ Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackMode⊢ ∃ q vL vR, HalfTapeView.casesOn vL List.length List.length ≤ 8 ∧ HalfTapeView.casesOn vR List.length List.length ≤ 8 ∧ ((∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = { q := some q, tape := { head := 0, left := applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L), right := applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R) } }) ∨ (∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headLeft q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) ∨ ∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headRight q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackModeq:ΛvL:HalfTapeView (Fin 2)vR:HalfTapeView (Fin 2)hl:HalfTapeView.casesOn vL List.length List.length ≤ 8hr:HalfTapeView.casesOn vR List.length List.length ≤ 8h1:∀ (L R : List ℕ), evalStackCfg1 m L R = { q := some q, tape := { head := 0, left := applyView vL (encLeft1 L), right := applyView vR (encRight1 R) } }⊢ ∃ q vL vR, HalfTapeView.casesOn vL List.length List.length ≤ 8 ∧ HalfTapeView.casesOn vR List.length List.length ≤ 8 ∧ ((∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = { q := some q, tape := { head := 0, left := applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L), right := applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R) } }) ∨ (∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headLeft q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) ∨ ∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headRight q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R)))Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackModeq:ΛvL:HalfTapeView (Fin 2)vR:HalfTapeView (Fin 2)hl:HalfTapeView.casesOn vL List.length List.length ≤ 8hr:HalfTapeView.casesOn vR List.length List.length ≤ 8h2:∀ (L R : List ℕ), evalStackCfg1 m L R = Cfg.headLeft q (applyView vL (encLeft1 L)) (applyView vR (encRight1 R))⊢ ∃ q vL vR, HalfTapeView.casesOn vL List.length List.length ≤ 8 ∧ HalfTapeView.casesOn vR List.length List.length ≤ 8 ∧ ((∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = { q := some q, tape := { head := 0, left := applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L), right := applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R) } }) ∨ (∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headLeft q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) ∨ ∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headRight q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R)))Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackModeq:ΛvL:HalfTapeView (Fin 2)vR:HalfTapeView (Fin 2)hl:HalfTapeView.casesOn vL List.length List.length ≤ 8hr:HalfTapeView.casesOn vR List.length List.length ≤ 8h3:∀ (L R : List ℕ), evalStackCfg1 m L R = Cfg.headRight q (applyView vL (encLeft1 L)) (applyView vR (encRight1 R))⊢ ∃ q vL vR, HalfTapeView.casesOn vL List.length List.length ≤ 8 ∧ HalfTapeView.casesOn vR List.length List.length ≤ 8 ∧ ((∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = { q := some q, tape := { head := 0, left := applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L), right := applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R) } }) ∨ (∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headLeft q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) ∨ ∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headRight q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackModeq:ΛvL:HalfTapeView (Fin 2)vR:HalfTapeView (Fin 2)hl:HalfTapeView.casesOn vL List.length List.length ≤ 8hr:HalfTapeView.casesOn vR List.length List.length ≤ 8h1:∀ (L R : List ℕ), evalStackCfg1 m L R = { q := some q, tape := { head := 0, left := applyView vL (encLeft1 L), right := applyView vR (encRight1 R) } }⊢ ∃ q vL vR, HalfTapeView.casesOn vL List.length List.length ≤ 8 ∧ HalfTapeView.casesOn vR List.length List.length ≤ 8 ∧ ((∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = { q := some q, tape := { head := 0, left := applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L), right := applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R) } }) ∨ (∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headLeft q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) ∨ ∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headRight q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) All goals completed! 🐙 Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackModeq:ΛvL:HalfTapeView (Fin 2)vR:HalfTapeView (Fin 2)hl:HalfTapeView.casesOn vL List.length List.length ≤ 8hr:HalfTapeView.casesOn vR List.length List.length ≤ 8h2:∀ (L R : List ℕ), evalStackCfg1 m L R = Cfg.headLeft q (applyView vL (encLeft1 L)) (applyView vR (encRight1 R))⊢ ∃ q vL vR, HalfTapeView.casesOn vL List.length List.length ≤ 8 ∧ HalfTapeView.casesOn vR List.length List.length ≤ 8 ∧ ((∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = { q := some q, tape := { head := 0, left := applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L), right := applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R) } }) ∨ (∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headLeft q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) ∨ ∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headRight q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) All goals completed! 🐙 Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackModeq:ΛvL:HalfTapeView (Fin 2)vR:HalfTapeView (Fin 2)hl:HalfTapeView.casesOn vL List.length List.length ≤ 8hr:HalfTapeView.casesOn vR List.length List.length ≤ 8h3:∀ (L R : List ℕ), evalStackCfg1 m L R = Cfg.headRight q (applyView vL (encLeft1 L)) (applyView vR (encRight1 R))⊢ ∃ q vL vR, HalfTapeView.casesOn vL List.length List.length ≤ 8 ∧ HalfTapeView.casesOn vR List.length List.length ≤ 8 ∧ ((∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = { q := some q, tape := { head := 0, left := applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L), right := applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R) } }) ∨ (∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headLeft q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) ∨ ∀ (L R : List (StackTuple (0 + 2))), (fun m L R ↦ evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) m L R = Cfg.headRight q (applyView vL ((fun L ↦ encLeft1 (List.map Prod.fst L)) L)) (applyView vR ((fun R ↦ encRight1 (List.map Prod.fst R)) R))) All goals completed! 🐙 Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀⊢ ∃ cfg₀, (init [] [target_tm]⊢⁺ cfg₀) ∧ (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg₀ Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackModeL1:List ℕR1:List ℕhcfg0:cfg₀ = evalStackCfg1 m L1 R1⊢ ∃ cfg₀, (init [] [target_tm]⊢⁺ cfg₀) ∧ (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg₀ Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackModeL1:List ℕR1:List ℕhcfg0:cfg₀ = evalStackCfg1 m L1 R1⊢ cfg₀ = evalStackCfg1 m (List.map Prod.fst (liftPairList L1)) (List.map Prod.fst (liftPairList R1)) try Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackModeL1:List ℕR1:List ℕhcfg0:cfg₀ = evalStackCfg1 m L1 R1⊢ cfg₀ = evalStackCfg1 m (List.map Prod.fst (liftPairList L1)) (List.map Prod.fst (liftPairList R1)) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀m:StackModeL1:List ℕR1:List ℕhcfg0:cfg₀ = evalStackCfg1 m L1 R1⊢ cfg₀ = evalStackCfg1 m L1 R1 All goals completed! 🐙 Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀⊢ ∀ (cfg : Cfg (Fin (0 + 2)) Λ), (fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ ((fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg' ∨ (step target_tm cfg').isNone = true) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀cfg:Cfg (Fin (0 + 2)) Λm:StackModeL:List (ℕ × ℕ)R:List (ℕ × ℕ)hcfg:cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)⊢ ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ ((fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg' ∨ (step target_tm cfg').isNone = true) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀cfg:Cfg (Fin (0 + 2)) Λm:StackModeL:List (ℕ × ℕ)R:List (ℕ × ℕ)hcfg:cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)hsys1:IsInStackSystem1 cfg⊢ ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ ((fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg' ∨ (step target_tm cfg').isNone = true) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀cfg:Cfg (Fin (0 + 2)) Λm:StackModeL:List (ℕ × ℕ)R:List (ℕ × ℕ)hcfg:cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)hsys1:IsInStackSystem1 cfgcfg':Cfg (Fin 2) Λhstep:cfg [target_tm]⊢⁺ cfg'hnext:IsInStackSystem1 cfg'⊢ ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ ((fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg' ∨ (step target_tm cfg').isNone = true)Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀cfg:Cfg (Fin (0 + 2)) Λm:StackModeL:List (ℕ × ℕ)R:List (ℕ × ℕ)hcfg:cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)hsys1:IsInStackSystem1 cfgcfg':Cfg (Fin 2) Λhstep:cfg [target_tm]⊢⁺ cfg'hhalt:(step target_tm cfg').isNone = true⊢ ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ ((fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg' ∨ (step target_tm cfg').isNone = true) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀cfg:Cfg (Fin (0 + 2)) Λm:StackModeL:List (ℕ × ℕ)R:List (ℕ × ℕ)hcfg:cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)hsys1:IsInStackSystem1 cfgcfg':Cfg (Fin 2) Λhstep:cfg [target_tm]⊢⁺ cfg'hnext:IsInStackSystem1 cfg'⊢ ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ ((fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg' ∨ (step target_tm cfg').isNone = true) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀cfg:Cfg (Fin (0 + 2)) Λm:StackModeL:List (ℕ × ℕ)R:List (ℕ × ℕ)hcfg:cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)hsys1:IsInStackSystem1 cfgcfg':Cfg (Fin 2) Λhstep:cfg [target_tm]⊢⁺ cfg'hnext:IsInStackSystem1 cfg'm':StackModeL1':List ℕR1':List ℕhcfg':cfg' = evalStackCfg1 m' L1' R1'⊢ ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ ((fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg' ∨ (step target_tm cfg').isNone = true) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀cfg:Cfg (Fin (0 + 2)) Λm:StackModeL:List (ℕ × ℕ)R:List (ℕ × ℕ)hcfg:cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)hsys1:IsInStackSystem1 cfgcfg':Cfg (Fin 2) Λhstep:cfg [target_tm]⊢⁺ cfg'hnext:IsInStackSystem1 cfg'm':StackModeL1':List ℕR1':List ℕhcfg':cfg' = evalStackCfg1 m' L1' R1'⊢ cfg' = evalStackCfg1 m' (List.map Prod.fst (liftPairList L1')) (List.map Prod.fst (liftPairList R1')) try Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀cfg:Cfg (Fin (0 + 2)) Λm:StackModeL:List (ℕ × ℕ)R:List (ℕ × ℕ)hcfg:cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)hsys1:IsInStackSystem1 cfgcfg':Cfg (Fin 2) Λhstep:cfg [target_tm]⊢⁺ cfg'hnext:IsInStackSystem1 cfg'm':StackModeL1':List ℕR1':List ℕhcfg':cfg' = evalStackCfg1 m' L1' R1'⊢ cfg' = evalStackCfg1 m' (List.map Prod.fst (liftPairList L1')) (List.map Prod.fst (liftPairList R1')) Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀cfg:Cfg (Fin (0 + 2)) Λm:StackModeL:List (ℕ × ℕ)R:List (ℕ × ℕ)hcfg:cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)hsys1:IsInStackSystem1 cfgcfg':Cfg (Fin 2) Λhstep:cfg [target_tm]⊢⁺ cfg'hnext:IsInStackSystem1 cfg'm':StackModeL1':List ℕR1':List ℕhcfg':cfg' = evalStackCfg1 m' L1' R1'⊢ cfg' = evalStackCfg1 m' L1' R1' All goals completed! 🐙 Λ:Type u_3inst✝:Inhabited Λtarget_tm:Machine (Fin 2) ΛStackMode:TypeencLeft1:List ℕ → ListBlank (Fin 2)encRight1:List ℕ → ListBlank (Fin 2)evalStackCfg1:StackMode → List ℕ → List ℕ → Cfg (Fin 2) ΛIsInStackSystem1:Cfg (Fin 2) Λ → ProphnilL:encLeft1 [] = defaulthnilR:encRight1 [] = defaulthheadL:∀ (a : ℕ) (L : List ℕ), (encLeft1 (a :: L)).head = 1hheadR:∀ (d : ℕ) (R : List ℕ), (encRight1 (d :: R)).head = 1tL:ListBlank (Fin 2)htL:tL.head = 1hnsL:∀ (L : List ℕ), encLeft1 L ≠ tLtR:ListBlank (Fin 2)htR:tR.head = 1hnsR:∀ (R : List ℕ), encRight1 R ≠ tRsL:ℕoL:ℕsepL:ℕsR:ℕoR:ℕsepR:ℕhsL:sL > 0hoL:oL > 0hsepL:sepL > 0hsR:sR > 0hoR:oR > 0hsepR:sepR > 0hblkL:∀ (a : ℕ) (L : List ℕ), encLeft1 (a :: L) = [1] ^ (sL * a + oL) +> [0] ^ sepL +> encLeft1 LhblkR:∀ (d : ℕ) (R : List ℕ), encRight1 (d :: R) = [1] ^ (sR * d + oR) +> [0] ^ sepR +> encRight1 Rhmodes:∃ modes, modes.length ≤ 6 ∧ ∀ (m : StackMode), m ∈ modeshvalid1:IsValidStackModes encLeft1 encRight1 evalStackCfg1hiff1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg ↔ ∃ m L R, cfg = evalStackCfg1 m L Rleft✝:∀ (m : StackMode) (L R : List ℕ), IsInStackSystem1 (evalStackCfg1 m L R)hclosed1:∀ (cfg : Cfg (Fin 2) Λ), IsInStackSystem1 cfg → ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ (IsInStackSystem1 cfg' ∨ (step target_tm cfg').isNone = true)cfg₀:Cfg (Fin 2) Λhinit0:init [] [target_tm]⊢⁺ cfg₀hsys0:IsInStackSystem1 cfg₀cfg:Cfg (Fin (0 + 2)) Λm:StackModeL:List (ℕ × ℕ)R:List (ℕ × ℕ)hcfg:cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)hsys1:IsInStackSystem1 cfgcfg':Cfg (Fin 2) Λhstep:cfg [target_tm]⊢⁺ cfg'hhalt:(step target_tm cfg').isNone = true⊢ ∃ cfg', (cfg [target_tm]⊢⁺ cfg') ∧ ((fun cfg ↦ ∃ m L R, cfg = evalStackCfg1 m (List.map Prod.fst L) (List.map Prod.fst R)) cfg' ∨ (step target_tm cfg').isNone = true) All goals completed! 🐙end BusyBeaver.PairStack