case intro.intro
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
⊢ (Tape.move Dir.left^[n]) (trTape' enc0 (ListBlank.cons a L) R) =
    trTape' enc0 (ListBlank.tail (ListBlank.cons a L)) (ListBlank.cons (ListBlank.head (ListBlank.cons a L)) R)
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
L R : ListBlank Γ
⊢ (Tape.move Dir.left^[n]) (trTape' enc0 L R) = trTape' enc0 (ListBlank.tail L) (ListBlank.cons (ListBlank.head L) R)
obtain ⟨a, L, rfl⟩ := L.exists_cons
case intro.intro
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
⊢ (Tape.move Dir.left^[n])
      (Tape.mk'
        (ListBlank.append (List.reverse (Vector.toList (enc a)))
          (ListBlank.bind L (fun x => List.reverse (Vector.toList (enc x)))
            (_ : ∃ n_1, (fun x => List.reverse (Vector.toList (enc x))) default = List.replicate n_1 default)))
        (ListBlank.bind R (fun x => Vector.toList (enc x))
          (_ : ∃ n_1, (fun x => Vector.toList (enc x)) default = List.replicate n_1 default))) =
    Tape.mk'
      (ListBlank.bind L (fun x => List.reverse (Vector.toList (enc x)))
        (_ : ∃ n_1, (fun x => List.reverse (Vector.toList (enc x))) default = List.replicate n_1 default))
      (ListBlank.append (Vector.toList (enc a))
        (ListBlank.bind R (fun x => Vector.toList (enc x))
          (_ : ∃ n_1, (fun x => Vector.toList (enc x)) default = List.replicate n_1 default)))
case intro.intro
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
⊢ (Tape.move Dir.left^[n]) (trTape' enc0 (ListBlank.cons a L) R) =
    trTape' enc0 (ListBlank.tail (ListBlank.cons a L)) (ListBlank.cons (ListBlank.head (ListBlank.cons a L)) R)
simp only [trTape', ListBlank.cons_bind, ListBlank.head_cons, ListBlank.tail_cons]
case intro.intro
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
⊢ ∀ {L' R' : ListBlank Bool} {l₁ l₂ : List Bool},
    Vector.toList (enc a) = List.reverseAux l₁ l₂ →
      (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L') (ListBlank.append l₂ R')) =
        Tape.mk' L' (ListBlank.append (Vector.toList (enc a)) R')
case intro.intro
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
⊢ (Tape.move Dir.left^[n])
      (Tape.mk'
        (ListBlank.append (List.reverse (Vector.toList (enc a)))
          (ListBlank.bind L (fun x => List.reverse (Vector.toList (enc x)))
            (_ : ∃ n_1, (fun x => List.reverse (Vector.toList (enc x))) default = List.replicate n_1 default)))
        (ListBlank.bind R (fun x => Vector.toList (enc x))
          (_ : ∃ n_1, (fun x => Vector.toList (enc x)) default = List.replicate n_1 default))) =
    Tape.mk'
      (ListBlank.bind L (fun x => List.reverse (Vector.toList (enc x)))
        (_ : ∃ n_1, (fun x => List.reverse (Vector.toList (enc x))) default = List.replicate n_1 default))
      (ListBlank.append (Vector.toList (enc a))
        (ListBlank.bind R (fun x => Vector.toList (enc x))
          (_ : ∃ n_1, (fun x => Vector.toList (enc x)) default = List.replicate n_1 default)))
suffices ∀ {L' R' l₁ l₂} (_ : Vector.toList (enc a) = List.reverseAux l₁ l₂),
    (Tape.move Dir.left^[l₁.length])
    (Tape.mk' (ListBlank.append l₁ L') (ListBlank.append l₂ R')) =
    Tape.mk' L' (ListBlank.append (Vector.toList (enc a)) R') by
  simpa only [List.length_reverse, Vector.toList_length] using this (List.reverse_reverse _).symm
case intro.intro
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁ l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux l₁ l₂
⊢ (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L'✝) (ListBlank.append l₂ R'✝)) =
    Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
case intro.intro
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
⊢ ∀ {L' R' : ListBlank Bool} {l₁ l₂ : List Bool},
    Vector.toList (enc a) = List.reverseAux l₁ l₂ →
      (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L') (ListBlank.append l₂ R')) =
        Tape.mk' L' (ListBlank.append (Vector.toList (enc a)) R')
intro _ _ l₁ l₂ e
case intro.intro.nil
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁ l₂✝ : List Bool
e✝ : Vector.toList (enc a) = List.reverseAux l₁ l₂✝
l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux [] l₂
⊢ (Tape.move Dir.left^[List.length []]) (Tape.mk' (ListBlank.append [] L'✝) (ListBlank.append l₂ R'✝)) =
    Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)

case intro.intro.cons
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁✝ l₂✝ : List Bool
e✝ : Vector.toList (enc a) = List.reverseAux l₁✝ l₂✝
b : Bool
l₁ : List Bool
IH :
  ∀ {l₂ : List Bool},
    Vector.toList (enc a) = List.reverseAux l₁ l₂ →
      (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L'✝) (ListBlank.append l₂ R'✝)) =
        Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux (b :: l₁) l₂
⊢ (Tape.move Dir.left^[List.length (b :: l₁)]) (Tape.mk' (ListBlank.append (b :: l₁) L'✝) (ListBlank.append l₂ R'✝)) =
    Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
case intro.intro
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁ l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux l₁ l₂
⊢ (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L'✝) (ListBlank.append l₂ R'✝)) =
    Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
induction' l₁ with b l₁ IH generalizing l₂
case intro.intro.cons
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁✝ l₂✝ : List Bool
e✝ : Vector.toList (enc a) = List.reverseAux l₁✝ l₂✝
b : Bool
l₁ : List Bool
IH :
  ∀ {l₂ : List Bool},
    Vector.toList (enc a) = List.reverseAux l₁ l₂ →
      (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L'✝) (ListBlank.append l₂ R'✝)) =
        Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux (b :: l₁) l₂
⊢ (Tape.move Dir.left^[List.length l₁])
      (Tape.move Dir.left (Tape.mk' (ListBlank.append (b :: l₁) L'✝) (ListBlank.append l₂ R'✝))) =
    Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
case intro.intro.cons
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁✝ l₂✝ : List Bool
e✝ : Vector.toList (enc a) = List.reverseAux l₁✝ l₂✝
b : Bool
l₁ : List Bool
IH :
  ∀ {l₂ : List Bool},
    Vector.toList (enc a) = List.reverseAux l₁ l₂ →
      (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L'✝) (ListBlank.append l₂ R'✝)) =
        Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux (b :: l₁) l₂
⊢ (Tape.move Dir.left^[List.length (b :: l₁)]) (Tape.mk' (ListBlank.append (b :: l₁) L'✝) (ListBlank.append l₂ R'✝)) =
    Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
simp only [List.length, List.cons_append, iterate_succ_apply]
case h.e'_2.h.e'_4
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁✝ l₂✝ : List Bool
e✝ : Vector.toList (enc a) = List.reverseAux l₁✝ l₂✝
b : Bool
l₁ : List Bool
IH :
  ∀ {l₂ : List Bool},
    Vector.toList (enc a) = List.reverseAux l₁ l₂ →
      (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L'✝) (ListBlank.append l₂ R'✝)) =
        Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux (b :: l₁) l₂
⊢ Tape.move Dir.left (Tape.mk' (ListBlank.append (b :: l₁) L'✝) (ListBlank.append l₂ R'✝)) =
    Tape.mk' (ListBlank.append l₁ L'✝) (ListBlank.append (b :: l₂) R'✝)
case intro.intro.cons
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁✝ l₂✝ : List Bool
e✝ : Vector.toList (enc a) = List.reverseAux l₁✝ l₂✝
b : Bool
l₁ : List Bool
IH :
  ∀ {l₂ : List Bool},
    Vector.toList (enc a) = List.reverseAux l₁ l₂ →
      (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L'✝) (ListBlank.append l₂ R'✝)) =
        Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux (b :: l₁) l₂
⊢ (Tape.move Dir.left^[List.length l₁])
      (Tape.move Dir.left (Tape.mk' (ListBlank.append (b :: l₁) L'✝) (ListBlank.append l₂ R'✝))) =
    Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
convert IH e
no goals
case h.e'_2.h.e'_4
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁✝ l₂✝ : List Bool
e✝ : Vector.toList (enc a) = List.reverseAux l₁✝ l₂✝
b : Bool
l₁ : List Bool
IH :
  ∀ {l₂ : List Bool},
    Vector.toList (enc a) = List.reverseAux l₁ l₂ →
      (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L'✝) (ListBlank.append l₂ R'✝)) =
        Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux (b :: l₁) l₂
⊢ Tape.move Dir.left (Tape.mk' (ListBlank.append (b :: l₁) L'✝) (ListBlank.append l₂ R'✝)) =
    Tape.mk' (ListBlank.append l₁ L'✝) (ListBlank.append (b :: l₂) R'✝)
simp only [ListBlank.tail_cons, ListBlank.append, Tape.move_left_mk', ListBlank.head_cons]
no goals
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
this :
  ∀ {L' R' : ListBlank Bool} {l₁ l₂ : List Bool},
    Vector.toList (enc a) = List.reverseAux l₁ l₂ →
      (Tape.move Dir.left^[List.length l₁]) (Tape.mk' (ListBlank.append l₁ L') (ListBlank.append l₂ R')) =
        Tape.mk' L' (ListBlank.append (Vector.toList (enc a)) R')
⊢ (Tape.move Dir.left^[n])
      (Tape.mk'
        (ListBlank.append (List.reverse (Vector.toList (enc a)))
          (ListBlank.bind L (fun x => List.reverse (Vector.toList (enc x)))
            (_ : ∃ n_1, (fun x => List.reverse (Vector.toList (enc x))) default = List.replicate n_1 default)))
        (ListBlank.bind R (fun x => Vector.toList (enc x))
          (_ : ∃ n_1, (fun x => Vector.toList (enc x)) default = List.replicate n_1 default))) =
    Tape.mk'
      (ListBlank.bind L (fun x => List.reverse (Vector.toList (enc x)))
        (_ : ∃ n_1, (fun x => List.reverse (Vector.toList (enc x))) default = List.replicate n_1 default))
      (ListBlank.append (Vector.toList (enc a))
        (ListBlank.bind R (fun x => Vector.toList (enc x))
          (_ : ∃ n_1, (fun x => Vector.toList (enc x)) default = List.replicate n_1 default)))
simpa only [List.length_reverse, Vector.toList_length] using this (List.reverse_reverse _).symm
case intro.intro.nil.refl
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁ l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux l₁ l₂
⊢ (Tape.move Dir.left^[List.length []]) (Tape.mk' (ListBlank.append [] L'✝) (ListBlank.append (enc a).1 R'✝)) =
    Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
case intro.intro.nil
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁ l₂✝ : List Bool
e✝ : Vector.toList (enc a) = List.reverseAux l₁ l₂✝
l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux [] l₂
⊢ (Tape.move Dir.left^[List.length []]) (Tape.mk' (ListBlank.append [] L'✝) (ListBlank.append l₂ R'✝)) =
    Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
cases e
no goals
case intro.intro.nil.refl
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type ?u.366855
inst✝¹ : Inhabited Λ
σ : Type ?u.366861
inst✝ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
R : ListBlank Γ
a : Γ
L : ListBlank Γ
L'✝ R'✝ : ListBlank Bool
l₁ l₂ : List Bool
e : Vector.toList (enc a) = List.reverseAux l₁ l₂
⊢ (Tape.move Dir.left^[List.length []]) (Tape.mk' (ListBlank.append [] L'✝) (ListBlank.append (enc a).1 R'✝)) =
    Tape.mk' L'✝ (ListBlank.append (Vector.toList (enc a)) R'✝)
rfl