l3lab/ntp-mathlib huggingface dataset:
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    

Proof state:
case intro.intro.intro.intro
q : Λ'
s : Option Γ'
n : ℕ
c d : List Γ'
a : PosNum
this :
  ∀ (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ a)) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum a ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
l₁' l₂' : List Γ'
s' : Option Γ'
e : trPosNum (PosNum.succ a) = List.reverseAux l₁' l₂'
h :
  Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum a ++ [Γ'.cons]) [] c d }
    { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
⊢ Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum a ++ [Γ'.cons]) [] c d }
    { l := some q, var := none, stk := elim (trPosNum (PosNum.succ a) ++ [Γ'.cons]) [] c d }

Next tactic:
refine' h.trans _
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    

Proof state:
case intro.intro.intro.intro
q : Λ'
s : Option Γ'
n : ℕ
c d : List Γ'
a : PosNum
this :
  ∀ (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ a)) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum a ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
l₁' l₂' : List Γ'
s' : Option Γ'
e : trPosNum (PosNum.succ a) = List.reverseAux l₁' l₂'
h :
  Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum a ++ [Γ'.cons]) [] c d }
    { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
⊢ TransGen (fun a b => b ∈ TM2.step tr a) { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
    { l := some q, var := none, stk := elim (trPosNum (PosNum.succ a) ++ [Γ'.cons]) [] c d }

Next tactic:
convert unrev_ok using 2
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    convert unrev_ok using 2
    

Proof state:
case h.e'_2.h.e'_7
q : Λ'
s : Option Γ'
n : ℕ
c d : List Γ'
a : PosNum
this :
  ∀ (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ a)) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum a ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
l₁' l₂' : List Γ'
s' : Option Γ'
e : trPosNum (PosNum.succ a) = List.reverseAux l₁' l₂'
h :
  Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum a ++ [Γ'.cons]) [] c d }
    { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
⊢ elim (trPosNum (PosNum.succ a) ++ [Γ'.cons]) [] c d =
    update (update (elim (l₂' ++ [Γ'.cons]) l₁' c d) rev []) main
      (List.reverseAux (elim (l₂' ++ [Γ'.cons]) l₁' c d rev) (elim (l₂' ++ [Γ'.cons]) l₁' c d main))

Next tactic:
simp [e, List.reverseAux_eq]
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    convert unrev_ok using 2
    simp [e, List.reverseAux_eq]
  

Proof state:
case pos
q : Λ'
s : Option Γ'
n : ℕ
c d : List Γ'
a : PosNum
⊢ ∀ (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ a)) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum a ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }

Next tactic:
induction' a with m IH m _ generalizing s
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    convert unrev_ok using 2
    simp [e, List.reverseAux_eq]
  induction' a with m IH m _ generalizing s <;> 

Proof state:
case pos.one
q : Λ'
n : ℕ
c d : List Γ'
s : Option Γ'
⊢ ∀ (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ PosNum.one)) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr)
          { l := some (Λ'.succ q), var := s, stk := elim (trPosNum PosNum.one ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }

Next tactic:
intro l₁
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    convert unrev_ok using 2
    simp [e, List.reverseAux_eq]
  induction' a with m IH m _ generalizing s <;> 

Proof state:
case pos.bit1
q : Λ'
n : ℕ
c d : List Γ'
m : PosNum
IH :
  ∀ {s : Option Γ'} (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ m)) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum m ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
s : Option Γ'
⊢ ∀ (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ (PosNum.bit1 m))) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr)
          { l := some (Λ'.succ q), var := s, stk := elim (trPosNum (PosNum.bit1 m) ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }

Next tactic:
intro l₁
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    convert unrev_ok using 2
    simp [e, List.reverseAux_eq]
  induction' a with m IH m _ generalizing s <;> 

Proof state:
case pos.bit0
q : Λ'
n : ℕ
c d : List Γ'
m : PosNum
a_ih✝ :
  ∀ {s : Option Γ'} (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ m)) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum m ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
s : Option Γ'
⊢ ∀ (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ (PosNum.bit0 m))) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr)
          { l := some (Λ'.succ q), var := s, stk := elim (trPosNum (PosNum.bit0 m) ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }

Next tactic:
intro l₁
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    convert unrev_ok using 2
    simp [e, List.reverseAux_eq]
  induction' a with m IH m _ generalizing s <;> intro l₁
  · 

Proof state:
case pos.one
q : Λ'
n : ℕ
c d : List Γ'
s : Option Γ'
l₁ : List Γ'
⊢ ∃ l₁' l₂' s',
    List.reverseAux l₁ (trPosNum (PosNum.succ PosNum.one)) = List.reverseAux l₁' l₂' ∧
      Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum PosNum.one ++ [Γ'.cons]) l₁ c d }
        { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }

Next tactic:
refine' ⟨Γ'.bit0 :: l₁, [Γ'.bit1], some Γ'.cons, rfl, TransGen.head rfl (TransGen.single _)⟩
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    convert unrev_ok using 2
    simp [e, List.reverseAux_eq]
  induction' a with m IH m _ generalizing s <;> intro l₁
  · refine' ⟨Γ'.bit0 :: l₁, [Γ'.bit1], some Γ'.cons, rfl, TransGen.head rfl (TransGen.single _)⟩
    

Proof state:
case pos.one
q : Λ'
n : ℕ
c d : List Γ'
s : Option Γ'
l₁ : List Γ'
⊢ { l := some (unrev q), var := some Γ'.cons, stk := elim ([Γ'.bit1] ++ [Γ'.cons]) (Γ'.bit0 :: l₁) c d } ∈
    TM2.step tr (TM2.stepAux (tr (Λ'.succ q)) s (elim (trPosNum PosNum.one ++ [Γ'.cons]) l₁ c d))

Next tactic:
simp [trPosNum]
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    convert unrev_ok using 2
    simp [e, List.reverseAux_eq]
  induction' a with m IH m _ generalizing s <;> intro l₁
  · refine' ⟨Γ'.bit0 :: l₁, [Γ'.bit1], some Γ'.cons, rfl, TransGen.head rfl (TransGen.single _)⟩
    simp [trPosNum]
  · 

Proof state:
case pos.bit1
q : Λ'
n : ℕ
c d : List Γ'
m : PosNum
IH :
  ∀ {s : Option Γ'} (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ m)) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum m ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
s : Option Γ'
l₁ : List Γ'
⊢ ∃ l₁' l₂' s',
    List.reverseAux l₁ (trPosNum (PosNum.succ (PosNum.bit1 m))) = List.reverseAux l₁' l₂' ∧
      Reaches₁ (TM2.step tr)
        { l := some (Λ'.succ q), var := s, stk := elim (trPosNum (PosNum.bit1 m) ++ [Γ'.cons]) l₁ c d }
        { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }

Next tactic:
obtain ⟨l₁', l₂', s', e, h⟩ := IH (Γ'.bit0 :: l₁)
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    convert unrev_ok using 2
    simp [e, List.reverseAux_eq]
  induction' a with m IH m _ generalizing s <;> intro l₁
  · refine' ⟨Γ'.bit0 :: l₁, [Γ'.bit1], some Γ'.cons, rfl, TransGen.head rfl (TransGen.single _)⟩
    simp [trPosNum]
  · obtain ⟨l₁', l₂', s', e, h⟩ := IH (Γ'.bit0 :: l₁)
    

Proof state:
case pos.bit1.intro.intro.intro.intro
q : Λ'
n : ℕ
c d : List Γ'
m : PosNum
IH :
  ∀ {s : Option Γ'} (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ m)) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum m ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
s : Option Γ'
l₁ l₁' l₂' : List Γ'
s' : Option Γ'
e : List.reverseAux (Γ'.bit0 :: l₁) (trPosNum (PosNum.succ m)) = List.reverseAux l₁' l₂'
h :
  Reaches₁ (TM2.step tr)
    { l := some (Λ'.succ q), var := ?m.561164, stk := elim (trPosNum m ++ [Γ'.cons]) (Γ'.bit0 :: l₁) c d }
    { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
⊢ ∃ l₁' l₂' s',
    List.reverseAux l₁ (trPosNum (PosNum.succ (PosNum.bit1 m))) = List.reverseAux l₁' l₂' ∧
      Reaches₁ (TM2.step tr)
        { l := some (Λ'.succ q), var := s, stk := elim (trPosNum (PosNum.bit1 m) ++ [Γ'.cons]) l₁ c d }
        { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }

Next tactic:
refine' ⟨l₁', l₂', s', e, TransGen.head _ h⟩
theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩ := by
  simp only [TM2.step, trList, trNat._eq_1, Nat.cast_succ, Num.add_one]
  cases' (n : Num) with a
  · refine' TransGen.head rfl _
    simp only [Option.mem_def, TM2.stepAux, elim_main, decide_False, elim_update_main, ne_eq,
      Function.update_noteq, elim_rev, elim_update_rev, decide_True, Function.update_same,
      cond_true, cond_false]
    convert unrev_ok using 1
    simp only [elim_update_rev, elim_rev, elim_main, List.reverseAux_nil, elim_update_main]
    rfl
  simp only [trNum, Num.succ, Num.succ']
  suffices ∀ l₁, ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum a.succ) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) ⟨some q.succ, s, K'.elim (trPosNum a ++ [Γ'.cons]) l₁ c d⟩
          ⟨some (unrev q), s', K'.elim (l₂' ++ [Γ'.cons]) l₁' c d⟩ by
    obtain ⟨l₁', l₂', s', e, h⟩ := this []
    simp? [List.reverseAux] at e says simp only [List.reverseAux] at e
    refine' h.trans _
    convert unrev_ok using 2
    simp [e, List.reverseAux_eq]
  induction' a with m IH m _ generalizing s <;> intro l₁
  · refine' ⟨Γ'.bit0 :: l₁, [Γ'.bit1], some Γ'.cons, rfl, TransGen.head rfl (TransGen.single _)⟩
    simp [trPosNum]
  · obtain ⟨l₁', l₂', s', e, h⟩ := IH (Γ'.bit0 :: l₁)
    refine' ⟨l₁', l₂', s', e, TransGen.head _ h⟩
    

Proof state:
case pos.bit1.intro.intro.intro.intro
q : Λ'
n : ℕ
c d : List Γ'
m : PosNum
IH :
  ∀ {s : Option Γ'} (l₁ : List Γ'),
    ∃ l₁' l₂' s',
      List.reverseAux l₁ (trPosNum (PosNum.succ m)) = List.reverseAux l₁' l₂' ∧
        Reaches₁ (TM2.step tr) { l := some (Λ'.succ q), var := s, stk := elim (trPosNum m ++ [Γ'.cons]) l₁ c d }
          { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
s : Option Γ'
l₁ l₁' l₂' : List Γ'
s' : Option Γ'
e : List.reverseAux (Γ'.bit0 :: l₁) (trPosNum (PosNum.succ m)) = List.reverseAux l₁' l₂'
h :
  Reaches₁ (TM2.step tr)
    { l := some (Λ'.succ q), var := ?m.561164, stk := elim (trPosNum m ++ [Γ'.cons]) (Γ'.bit0 :: l₁) c d }
    { l := some (unrev q), var := s', stk := elim (l₂' ++ [Γ'.cons]) l₁' c d }
⊢ { l := some (Λ'.succ q), var := ?m.561164, stk := elim (trPosNum m ++ [Γ'.cons]) (Γ'.bit0 :: l₁) c d } ∈
    TM2.step tr { l := some (Λ'.succ q), var := s, stk := elim (trPosNum (PosNum.bit1 m) ++ [Γ'.cons]) l₁ c d }

Next tactic:
simp [PosNum.succ, trPosNum]