l3lab/ntp-mathlib huggingface dataset:
theorem tr_respects : Respects (TM0.step M) (TM1.step (tr M)) fun a b ↦ trCfg M a = b :=
  fun_respects.2 fun ⟨q, T⟩ ↦ by
    cases' e : M q T.1 with val
    · simp only [TM0.step, trCfg, e]; exact Eq.refl none
    cases' val with q' s
    simp only [FRespects, TM0.step, trCfg, e, Option.isSome, cond, Option.map_some']
    revert e  -- Porting note: Added this so that `e` doesn't get into the `match`.
    have : TM1.step (tr M) ⟨some (Λ'.act s q'), (), T⟩ = some ⟨some (Λ'.normal q'), (), match s with
        | TM0.Stmt.move d => T.move d
        | TM0.Stmt.write a => T.write a⟩ := by
      cases' s with d a <;> rfl
    intro e
    refine' TransGen.head _ (TransGen.head' this _)
    · simp only [TM1.step, TM1.stepAux]
      rw [e]
      rfl
    cases e' : M q' _
    · apply ReflTransGen.single
      simp only [TM1.step, TM1.stepAux]
      rw [e']
      

Proof state:
case some.mk.refine'_2.none.hab
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
inst✝ : Inhabited Λ
M : TM0.Machine Γ Λ
x✝ : Cfg₀
q : Λ
T : Tape Γ
q' : Λ
s : TM0.Stmt Γ
this :
  TM1.step (tr M) { l := some (Λ'.act s q'), var := (), Tape := T } =
    some
      { l := some (Λ'.normal q'), var := (),
        Tape :=
          match s with
          | TM0.Stmt.move d => Tape.move d T
          | TM0.Stmt.write a => Tape.write a T }
e : M q T.head = some (q', s)
e' :
  M q'
      (match s with
        | TM0.Stmt.move d => Tape.move d T
        | TM0.Stmt.write a => Tape.write a T).head =
    none
⊢ { l := none, var := (),
      Tape :=
        match s with
        | TM0.Stmt.move d => Tape.move d T
        | TM0.Stmt.write a => Tape.write a T } ∈
    some
      (bif Option.isNone none then
        { l := none, var := (),
          Tape :=
            match s with
            | TM0.Stmt.move d => Tape.move d T
            | TM0.Stmt.write a => Tape.write a T }
      else
        {
          l :=
            some
              (match none with
              | none => default
              | some (q', s) => Λ'.act s q'),
          var := (),
          Tape :=
            match s with
            | TM0.Stmt.move d => Tape.move d T
            | TM0.Stmt.write a => Tape.write a T })

Next tactic:
rfl
theorem tr_respects : Respects (TM0.step M) (TM1.step (tr M)) fun a b ↦ trCfg M a = b :=
  fun_respects.2 fun ⟨q, T⟩ ↦ by
    cases' e : M q T.1 with val
    · simp only [TM0.step, trCfg, e]; exact Eq.refl none
    cases' val with q' s
    simp only [FRespects, TM0.step, trCfg, e, Option.isSome, cond, Option.map_some']
    revert e  -- Porting note: Added this so that `e` doesn't get into the `match`.
    have : TM1.step (tr M) ⟨some (Λ'.act s q'), (), T⟩ = some ⟨some (Λ'.normal q'), (), match s with
        | TM0.Stmt.move d => T.move d
        | TM0.Stmt.write a => T.write a⟩ := by
      cases' s with d a <;> rfl
    intro e
    refine' TransGen.head _ (TransGen.head' this _)
    · simp only [TM1.step, TM1.stepAux]
      rw [e]
      rfl
    cases e' : M q' _
    · apply ReflTransGen.single
      simp only [TM1.step, TM1.stepAux]
      rw [e']
      rfl
    · 

Proof state:
case some.mk.refine'_2.some
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
inst✝ : Inhabited Λ
M : TM0.Machine Γ Λ
x✝ : Cfg₀
q : Λ
T : Tape Γ
q' : Λ
s : TM0.Stmt Γ
this :
  TM1.step (tr M) { l := some (Λ'.act s q'), var := (), Tape := T } =
    some
      { l := some (Λ'.normal q'), var := (),
        Tape :=
          match s with
          | TM0.Stmt.move d => Tape.move d T
          | TM0.Stmt.write a => Tape.write a T }
e : M q T.head = some (q', s)
val✝ : Λ × TM0.Stmt Γ
e' :
  M q'
      (match s with
        | TM0.Stmt.move d => Tape.move d T
        | TM0.Stmt.write a => Tape.write a T).head =
    some val✝
⊢ ReflTransGen (fun a b => b ∈ TM1.step (tr M) a)
    { l := some (Λ'.normal q'), var := (),
      Tape :=
        match s with
        | TM0.Stmt.move d => Tape.move d T
        | TM0.Stmt.write a => Tape.write a T }
    {
      l :=
        match
          match some val✝ with
          | some val => true
          | none => false with
        | true => some (Λ'.normal q')
        | false => none,
      var := (),
      Tape :=
        match s with
        | TM0.Stmt.move d => Tape.move d T
        | TM0.Stmt.write a => Tape.write a T }

Next tactic:
rfl
theorem stmts₁_self {q : Stmt₂} : q ∈ stmts₁ q := by
  

Proof state:
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q : Stmt₂
⊢ q ∈ stmts₁ q

Next tactic:
cases q
theorem stmts₁_self {q : Stmt₂} : q ∈ stmts₁ q := by
  cases q <;> 

Proof state:
case push
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
k✝ : K
a✝¹ : σ → Γ k✝
a✝ : Stmt₂
⊢ push k✝ a✝¹ a✝ ∈ stmts₁ (push k✝ a✝¹ a✝)

Next tactic:
simp only [Finset.mem_insert_self, Finset.mem_singleton_self, stmts₁]
theorem stmts₁_self {q : Stmt₂} : q ∈ stmts₁ q := by
  cases q <;> 

Proof state:
case peek
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
k✝ : K
a✝¹ : σ → Option (Γ k✝) → σ
a✝ : Stmt₂
⊢ peek k✝ a✝¹ a✝ ∈ stmts₁ (peek k✝ a✝¹ a✝)

Next tactic:
simp only [Finset.mem_insert_self, Finset.mem_singleton_self, stmts₁]
theorem stmts₁_self {q : Stmt₂} : q ∈ stmts₁ q := by
  cases q <;> 

Proof state:
case pop
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
k✝ : K
a✝¹ : σ → Option (Γ k✝) → σ
a✝ : Stmt₂
⊢ pop k✝ a✝¹ a✝ ∈ stmts₁ (pop k✝ a✝¹ a✝)

Next tactic:
simp only [Finset.mem_insert_self, Finset.mem_singleton_self, stmts₁]
theorem stmts₁_self {q : Stmt₂} : q ∈ stmts₁ q := by
  cases q <;> 

Proof state:
case load
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
a✝¹ : σ → σ
a✝ : Stmt₂
⊢ load a✝¹ a✝ ∈ stmts₁ (load a✝¹ a✝)

Next tactic:
simp only [Finset.mem_insert_self, Finset.mem_singleton_self, stmts₁]
theorem stmts₁_self {q : Stmt₂} : q ∈ stmts₁ q := by
  cases q <;> 

Proof state:
case branch
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
a✝² : σ → Bool
a✝¹ a✝ : Stmt₂
⊢ branch a✝² a✝¹ a✝ ∈ stmts₁ (branch a✝² a✝¹ a✝)

Next tactic:
simp only [Finset.mem_insert_self, Finset.mem_singleton_self, stmts₁]
theorem stmts₁_self {q : Stmt₂} : q ∈ stmts₁ q := by
  cases q <;> 

Proof state:
case goto
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
a✝ : σ → Λ
⊢ goto a✝ ∈ stmts₁ (goto a✝)

Next tactic:
simp only [Finset.mem_insert_self, Finset.mem_singleton_self, stmts₁]
theorem stmts₁_self {q : Stmt₂} : q ∈ stmts₁ q := by
  cases q <;> 

Proof state:
case halt
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
⊢ halt ∈ stmts₁ halt

Next tactic:
simp only [Finset.mem_insert_self, Finset.mem_singleton_self, stmts₁]
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  

Proof state:
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₂ : Stmt₂
⊢ q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂

Next tactic:
intro h₁₂ q₀ h₀₁
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  

Proof state:
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₂ : Stmt₂
h₁₂ : q₁ ∈ stmts₁ q₂
q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
⊢ q₀ ∈ stmts₁ q₂

Next tactic:
induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> 

Proof state:
case push
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Γ k✝
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ ∈ stmts₁ (push k✝ a✝ q)
⊢ q₀ ∈ stmts₁ (push k✝ a✝ q)

Next tactic:
simp only [stmts₁] at h₁₂ ⊢
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> 

Proof state:
case peek
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ ∈ stmts₁ (peek k✝ a✝ q)
⊢ q₀ ∈ stmts₁ (peek k✝ a✝ q)

Next tactic:
simp only [stmts₁] at h₁₂ ⊢
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> 

Proof state:
case pop
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ ∈ stmts₁ (pop k✝ a✝ q)
⊢ q₀ ∈ stmts₁ (pop k✝ a✝ q)

Next tactic:
simp only [stmts₁] at h₁₂ ⊢
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> 

Proof state:
case load
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝ : σ → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ ∈ stmts₁ (load a✝ q)
⊢ q₀ ∈ stmts₁ (load a✝ q)

Next tactic:
simp only [stmts₁] at h₁₂ ⊢
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> 

Proof state:
case branch
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝² : σ → Bool
a✝¹ a✝ : Stmt₂
a_ih✝¹ : q₁ ∈ stmts₁ a✝¹ → q₀ ∈ stmts₁ a✝¹
a_ih✝ : q₁ ∈ stmts₁ a✝ → q₀ ∈ stmts₁ a✝
h₁₂ : q₁ ∈ stmts₁ (branch a✝² a✝¹ a✝)
⊢ q₀ ∈ stmts₁ (branch a✝² a✝¹ a✝)

Next tactic:
simp only [stmts₁] at h₁₂ ⊢
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> 

Proof state:
case goto
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝ : σ → Λ
h₁₂ : q₁ ∈ stmts₁ (goto a✝)
⊢ q₀ ∈ stmts₁ (goto a✝)

Next tactic:
simp only [stmts₁] at h₁₂ ⊢
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> 

Proof state:
case halt
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
h₁₂ : q₁ ∈ stmts₁ halt
⊢ q₀ ∈ stmts₁ halt

Next tactic:
simp only [stmts₁] at h₁₂ ⊢
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    

Proof state:
case push
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Γ k✝
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ ∈ insert (push k✝ a✝ q) (stmts₁ q)
⊢ q₀ ∈ insert (push k✝ a✝ q) (stmts₁ q)

Next tactic:
simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    

Proof state:
case peek
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ ∈ insert (peek k✝ a✝ q) (stmts₁ q)
⊢ q₀ ∈ insert (peek k✝ a✝ q) (stmts₁ q)

Next tactic:
simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    

Proof state:
case pop
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ ∈ insert (pop k✝ a✝ q) (stmts₁ q)
⊢ q₀ ∈ insert (pop k✝ a✝ q) (stmts₁ q)

Next tactic:
simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    

Proof state:
case load
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝ : σ → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ ∈ insert (load a✝ q) (stmts₁ q)
⊢ q₀ ∈ insert (load a✝ q) (stmts₁ q)

Next tactic:
simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    

Proof state:
case branch
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝² : σ → Bool
a✝¹ a✝ : Stmt₂
a_ih✝¹ : q₁ ∈ stmts₁ a✝¹ → q₀ ∈ stmts₁ a✝¹
a_ih✝ : q₁ ∈ stmts₁ a✝ → q₀ ∈ stmts₁ a✝
h₁₂ : q₁ ∈ insert (branch a✝² a✝¹ a✝) (stmts₁ a✝¹ ∪ stmts₁ a✝)
⊢ q₀ ∈ insert (branch a✝² a✝¹ a✝) (stmts₁ a✝¹ ∪ stmts₁ a✝)

Next tactic:
simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    

Proof state:
case goto
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝ : σ → Λ
h₁₂ : q₁ ∈ {goto a✝}
⊢ q₀ ∈ {goto a✝}

Next tactic:
simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    

Proof state:
case halt
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
h₁₂ : q₁ ∈ {halt}
⊢ q₀ ∈ {halt}

Next tactic:
simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
  

Proof state:
case push
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Γ k✝
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = push k✝ a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (push k✝ a✝ q) (stmts₁ q)
case peek
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = peek k✝ a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (peek k✝ a✝ q) (stmts₁ q)
case pop
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = pop k✝ a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (pop k✝ a✝ q) (stmts₁ q)
case load
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝ : σ → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = load a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (load a✝ q) (stmts₁ q)
case branch
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝² : σ → Bool
a✝¹ a✝ : Stmt₂
a_ih✝¹ : q₁ ∈ stmts₁ a✝¹ → q₀ ∈ stmts₁ a✝¹
a_ih✝ : q₁ ∈ stmts₁ a✝ → q₀ ∈ stmts₁ a✝
h₁₂ : q₁ = branch a✝² a✝¹ a✝ ∨ q₁ ∈ stmts₁ a✝¹ ∨ q₁ ∈ stmts₁ a✝
⊢ q₀ ∈ insert (branch a✝² a✝¹ a✝) (stmts₁ a✝¹ ∪ stmts₁ a✝)
case goto
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝ : σ → Λ
h₁₂ : q₁ = goto a✝
⊢ q₀ ∈ {goto a✝}
case halt
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
h₁₂ : q₁ = halt
⊢ q₀ ∈ {halt}

Next tactic:
iterate 4
    rcases h₁₂ with (rfl | h₁₂)
    · unfold stmts₁ at h₀₁
      exact h₀₁
    · exact Finset.mem_insert_of_mem (IH h₁₂)
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
  iterate 4
    

Proof state:
case push
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Γ k✝
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = push k✝ a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (push k✝ a✝ q) (stmts₁ q)
case peek
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = peek k✝ a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (peek k✝ a✝ q) (stmts₁ q)
case pop
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = pop k✝ a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (pop k✝ a✝ q) (stmts₁ q)
case load
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝ : σ → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = load a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (load a✝ q) (stmts₁ q)
case branch
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝² : σ → Bool
a✝¹ a✝ : Stmt₂
a_ih✝¹ : q₁ ∈ stmts₁ a✝¹ → q₀ ∈ stmts₁ a✝¹
a_ih✝ : q₁ ∈ stmts₁ a✝ → q₀ ∈ stmts₁ a✝
h₁₂ : q₁ = branch a✝² a✝¹ a✝ ∨ q₁ ∈ stmts₁ a✝¹ ∨ q₁ ∈ stmts₁ a✝
⊢ q₀ ∈ insert (branch a✝² a✝¹ a✝) (stmts₁ a✝¹ ∪ stmts₁ a✝)
case goto
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝ : σ → Λ
h₁₂ : q₁ = goto a✝
⊢ q₀ ∈ {goto a✝}
case halt
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
h₁₂ : q₁ = halt
⊢ q₀ ∈ {halt}

Next tactic:
rcases h₁₂ with (rfl | h₁₂)
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
  iterate 4
    rcases h₁₂ with (rfl | h₁₂)
    · 

Proof state:
case push.inl
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₀ : Stmt₂
k✝ : K
a✝ : σ → Γ k✝
q : Stmt₂
h₀₁ : q₀ ∈ stmts₁ (push k✝ a✝ q)
IH : push k✝ a✝ q ∈ stmts₁ q → q₀ ∈ stmts₁ q
⊢ q₀ ∈ insert (push k✝ a✝ q) (stmts₁ q)

Next tactic:
unfold stmts₁ at h₀₁
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
  iterate 4
    rcases h₁₂ with (rfl | h₁₂)
    · unfold stmts₁ at h₀₁
      

Proof state:
case push.inl
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₀ : Stmt₂
k✝ : K
a✝ : σ → Γ k✝
q : Stmt₂
IH : push k✝ a✝ q ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₀₁ : q₀ ∈ insert (push k✝ a✝ q) (stmts₁ q)
⊢ q₀ ∈ insert (push k✝ a✝ q) (stmts₁ q)

Next tactic:
exact h₀₁
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
  iterate 4
    rcases h₁₂ with (rfl | h₁₂)
    · unfold stmts₁ at h₀₁
      exact h₀₁
    · 

Proof state:
case push.inr
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Γ k✝
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (push k✝ a✝ q) (stmts₁ q)

Next tactic:
exact Finset.mem_insert_of_mem (IH h₁₂)
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
  iterate 4
    

Proof state:
case peek
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = peek k✝ a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (peek k✝ a✝ q) (stmts₁ q)
case pop
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = pop k✝ a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (pop k✝ a✝ q) (stmts₁ q)
case load
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝ : σ → σ
q : Stmt₂
IH : q₁ ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₁₂ : q₁ = load a✝ q ∨ q₁ ∈ stmts₁ q
⊢ q₀ ∈ insert (load a✝ q) (stmts₁ q)
case branch
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝² : σ → Bool
a✝¹ a✝ : Stmt₂
a_ih✝¹ : q₁ ∈ stmts₁ a✝¹ → q₀ ∈ stmts₁ a✝¹
a_ih✝ : q₁ ∈ stmts₁ a✝ → q₀ ∈ stmts₁ a✝
h₁₂ : q₁ = branch a✝² a✝¹ a✝ ∨ q₁ ∈ stmts₁ a✝¹ ∨ q₁ ∈ stmts₁ a✝
⊢ q₀ ∈ insert (branch a✝² a✝¹ a✝) (stmts₁ a✝¹ ∪ stmts₁ a✝)
case goto
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
a✝ : σ → Λ
h₁₂ : q₁ = goto a✝
⊢ q₀ ∈ {goto a✝}
case halt
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₁ q₀ : Stmt₂
h₀₁ : q₀ ∈ stmts₁ q₁
h₁₂ : q₁ = halt
⊢ q₀ ∈ {halt}

Next tactic:
rcases h₁₂ with (rfl | h₁₂)
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
  iterate 4
    rcases h₁₂ with (rfl | h₁₂)
    · 

Proof state:
case peek.inl
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₀ : Stmt₂
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
h₀₁ : q₀ ∈ stmts₁ (peek k✝ a✝ q)
IH : peek k✝ a✝ q ∈ stmts₁ q → q₀ ∈ stmts₁ q
⊢ q₀ ∈ insert (peek k✝ a✝ q) (stmts₁ q)

Next tactic:
unfold stmts₁ at h₀₁
theorem stmts₁_trans {q₁ q₂ : Stmt₂} : q₁ ∈ stmts₁ q₂ → stmts₁ q₁ ⊆ stmts₁ q₂ := by
  intro h₁₂ q₀ h₀₁
  induction' q₂ with _ _ q IH _ _ q IH _ _ q IH _ q IH <;> simp only [stmts₁] at h₁₂ ⊢ <;>
    simp only [Finset.mem_insert, Finset.mem_singleton, Finset.mem_union] at h₁₂
  iterate 4
    rcases h₁₂ with (rfl | h₁₂)
    · unfold stmts₁ at h₀₁
      

Proof state:
case peek.inl
K : Type u_1
inst✝ : DecidableEq K
Γ : K → Type u_2
Λ : Type u_3
σ : Type u_4
q₀ : Stmt₂
k✝ : K
a✝ : σ → Option (Γ k✝) → σ
q : Stmt₂
IH : peek k✝ a✝ q ∈ stmts₁ q → q₀ ∈ stmts₁ q
h₀₁ : q₀ ∈ insert (peek k✝ a✝ q) (stmts₁ q)
⊢ q₀ ∈ insert (peek k✝ a✝ q) (stmts₁ q)

Next tactic:
exact h₀₁