l3lab/ntp-mathlib huggingface dataset:
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    

Proof state:
case branch
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
a✝² : Γ → σ → Bool
a✝¹ a✝ : Stmt₁
a_ih✝¹ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S a✝¹ → (stepAux a✝¹ v T).l ∈ Finset.insertNone S
a_ih✝ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S a✝ → (stepAux a✝ v T).l ∈ Finset.insertNone S
v : σ
T : Tape Γ
hs : SupportsStmt S (branch a✝² a✝¹ a✝)
⊢ (stepAux (branch a✝² a✝¹ a✝) v T).l ∈ Finset.insertNone S
case goto
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
a✝ : Γ → σ → Λ
v : σ
T : Tape Γ
hs : SupportsStmt S (goto a✝)
⊢ (stepAux (goto a✝) v T).l ∈ Finset.insertNone S
case halt
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
v : σ
T : Tape Γ
hs : SupportsStmt S halt
⊢ (stepAux halt v T).l ∈ Finset.insertNone S

Next tactic:
case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; cases p T.1 v
      · exact IH₂ _ _ hs.2
      · exact IH₁ _ _ hs.1
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    

Proof state:
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
p : Γ → σ → Bool
q₁' q₂' : Stmt₁
IH₁ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S q₁' → (stepAux q₁' v T).l ∈ Finset.insertNone S
IH₂ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S q₂' → (stepAux q₂' v T).l ∈ Finset.insertNone S
v : σ
T : Tape Γ
hs : SupportsStmt S (branch p q₁' q₂')
⊢ (stepAux (branch p q₁' q₂') v T).l ∈ Finset.insertNone S

Next tactic:
case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; cases p T.1 v
      · exact IH₂ _ _ hs.2
      · exact IH₁ _ _ hs.1
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    case branch p q₁' q₂' IH₁ IH₂ =>
      

Proof state:
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
p : Γ → σ → Bool
q₁' q₂' : Stmt₁
IH₁ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S q₁' → (stepAux q₁' v T).l ∈ Finset.insertNone S
IH₂ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S q₂' → (stepAux q₂' v T).l ∈ Finset.insertNone S
v : σ
T : Tape Γ
hs : SupportsStmt S (branch p q₁' q₂')
⊢ (stepAux (branch p q₁' q₂') v T).l ∈ Finset.insertNone S

Next tactic:
unfold stepAux
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; 

Proof state:
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
p : Γ → σ → Bool
q₁' q₂' : Stmt₁
IH₁ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S q₁' → (stepAux q₁' v T).l ∈ Finset.insertNone S
IH₂ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S q₂' → (stepAux q₂' v T).l ∈ Finset.insertNone S
v : σ
T : Tape Γ
hs : SupportsStmt S (branch p q₁' q₂')
⊢ (bif p T.head v then stepAux q₁' v T else stepAux q₂' v T).l ∈ Finset.insertNone S

Next tactic:
cases p T.1 v
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; cases p T.1 v
      · 

Proof state:
case false
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
p : Γ → σ → Bool
q₁' q₂' : Stmt₁
IH₁ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S q₁' → (stepAux q₁' v T).l ∈ Finset.insertNone S
IH₂ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S q₂' → (stepAux q₂' v T).l ∈ Finset.insertNone S
v : σ
T : Tape Γ
hs : SupportsStmt S (branch p q₁' q₂')
⊢ (bif false then stepAux q₁' v T else stepAux q₂' v T).l ∈ Finset.insertNone S

Next tactic:
exact IH₂ _ _ hs.2
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; cases p T.1 v
      · exact IH₂ _ _ hs.2
      · 

Proof state:
case true
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
p : Γ → σ → Bool
q₁' q₂' : Stmt₁
IH₁ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S q₁' → (stepAux q₁' v T).l ∈ Finset.insertNone S
IH₂ : ∀ (v : σ) (T : Tape Γ), SupportsStmt S q₂' → (stepAux q₂' v T).l ∈ Finset.insertNone S
v : σ
T : Tape Γ
hs : SupportsStmt S (branch p q₁' q₂')
⊢ (bif true then stepAux q₁' v T else stepAux q₂' v T).l ∈ Finset.insertNone S

Next tactic:
exact IH₁ _ _ hs.1
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; cases p T.1 v
      · exact IH₂ _ _ hs.2
      · exact IH₁ _ _ hs.1
    

Proof state:
case goto
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
a✝ : Γ → σ → Λ
v : σ
T : Tape Γ
hs : SupportsStmt S (goto a✝)
⊢ (stepAux (goto a✝) v T).l ∈ Finset.insertNone S
case halt
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
v : σ
T : Tape Γ
hs : SupportsStmt S halt
⊢ (stepAux halt v T).l ∈ Finset.insertNone S

Next tactic:
case goto => exact Finset.some_mem_insertNone.2 (hs _ _)
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; cases p T.1 v
      · exact IH₂ _ _ hs.2
      · exact IH₁ _ _ hs.1
    

Proof state:
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
a✝ : Γ → σ → Λ
v : σ
T : Tape Γ
hs : SupportsStmt S (goto a✝)
⊢ (stepAux (goto a✝) v T).l ∈ Finset.insertNone S

Next tactic:
case goto => exact Finset.some_mem_insertNone.2 (hs _ _)
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; cases p T.1 v
      · exact IH₂ _ _ hs.2
      · exact IH₁ _ _ hs.1
    case goto => 

Proof state:
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
a✝ : Γ → σ → Λ
v : σ
T : Tape Γ
hs : SupportsStmt S (goto a✝)
⊢ (stepAux (goto a✝) v T).l ∈ Finset.insertNone S

Next tactic:
exact Finset.some_mem_insertNone.2 (hs _ _)
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; cases p T.1 v
      · exact IH₂ _ _ hs.2
      · exact IH₁ _ _ hs.1
    case goto => exact Finset.some_mem_insertNone.2 (hs _ _)
    

Proof state:
case halt
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
v : σ
T : Tape Γ
hs : SupportsStmt S halt
⊢ (stepAux halt v T).l ∈ Finset.insertNone S

Next tactic:
case halt => apply Multiset.mem_cons_self
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; cases p T.1 v
      · exact IH₂ _ _ hs.2
      · exact IH₁ _ _ hs.1
    case goto => exact Finset.some_mem_insertNone.2 (hs _ _)
    

Proof state:
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
v : σ
T : Tape Γ
hs : SupportsStmt S halt
⊢ (stepAux halt v T).l ∈ Finset.insertNone S

Next tactic:
case halt => apply Multiset.mem_cons_self
theorem step_supports (M : Λ → Stmt₁) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₁}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S
  | ⟨some l₁, v, T⟩, c', h₁, h₂ => by
    replace h₂ := ss.2 _ (Finset.some_mem_insertNone.1 h₂)
    simp only [step, Option.mem_def, Option.some.injEq] at h₁; subst c'
    revert h₂; induction' M l₁ with _ q IH _ q IH _ q IH generalizing v T <;> intro hs
    iterate 3 exact IH _ _ hs
    case branch p q₁' q₂' IH₁ IH₂ =>
      unfold stepAux; cases p T.1 v
      · exact IH₂ _ _ hs.2
      · exact IH₁ _ _ hs.1
    case goto => exact Finset.some_mem_insertNone.2 (hs _ _)
    case halt => 

Proof state:
Γ : Type u_1
inst✝¹ : Inhabited Γ
Λ : Type u_2
σ : Type u_3
inst✝ : Inhabited Λ
M : Λ → Stmt₁
S : Finset Λ
ss : Supports M S
l₁ : Λ
v : σ
T : Tape Γ
hs : SupportsStmt S halt
⊢ (stepAux halt v T).l ∈ Finset.insertNone S

Next tactic:
apply Multiset.mem_cons_self
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    

Proof state:
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
l₁ : Option Λ
v : σ
T : Tape Γ
⊢ FRespects (TM0.step (tr M)) (fun c₁ => trCfg M c₁) (trCfg M { l := l₁, var := v, Tape := T })
    (TM1.step M { l := l₁, var := v, Tape := T })

Next tactic:
cases' l₁ with l₁
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    cases' l₁ with l₁; · 

Proof state:
case none
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
v : σ
T : Tape Γ
⊢ FRespects (TM0.step (tr M)) (fun c₁ => trCfg M c₁) (trCfg M { l := none, var := v, Tape := T })
    (TM1.step M { l := none, var := v, Tape := T })

Next tactic:
exact rfl
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    cases' l₁ with l₁; · exact rfl
    

Proof state:
case some
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
v : σ
T : Tape Γ
l₁ : Λ
⊢ FRespects (TM0.step (tr M)) (fun c₁ => trCfg M c₁) (trCfg M { l := some l₁, var := v, Tape := T })
    (TM1.step M { l := some l₁, var := v, Tape := T })

Next tactic:
simp only [trCfg, TM1.step, FRespects, Option.map]
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    cases' l₁ with l₁; · exact rfl
    simp only [trCfg, TM1.step, FRespects, Option.map]
    

Proof state:
case some
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
v : σ
T : Tape Γ
l₁ : Λ
⊢ Reaches₁ (TM0.step (tr M)) { q := (some (M l₁), v), Tape := T }
    {
      q :=
        (match (TM1.stepAux (M l₁) v T).l with
          | some x => some (M x)
          | none => none,
          (TM1.stepAux (M l₁) v T).var),
      Tape := (TM1.stepAux (M l₁) v T).Tape }

Next tactic:
induction' M l₁ with _ _ IH _ _ IH _ _ IH generalizing v T
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    cases' l₁ with l₁; · exact rfl
    simp only [trCfg, TM1.step, FRespects, Option.map]
    induction' M l₁ with _ _ IH _ _ IH _ _ IH generalizing v T
    

Proof state:
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
l₁ : Λ
a✝ : Dir
IH✝ : Stmt₁
IH :
  ∀ (v : σ) (T : Tape Γ),
    Reaches₁ (TM0.step (tr M)) { q := (some IH✝, v), Tape := T }
      {
        q :=
          (match (TM1.stepAux IH✝ v T).l with
            | some x => some (M x)
            | none => none,
            (TM1.stepAux IH✝ v T).var),
        Tape := (TM1.stepAux IH✝ v T).Tape }
v : σ
T : Tape Γ
⊢ Reaches₁ (TM0.step (tr M)) { q := (some (TM1.Stmt.move a✝ IH✝), v), Tape := T }
    {
      q :=
        (match (TM1.stepAux (TM1.Stmt.move a✝ IH✝) v T).l with
          | some x => some (M x)
          | none => none,
          (TM1.stepAux (TM1.Stmt.move a✝ IH✝) v T).var),
      Tape := (TM1.stepAux (TM1.Stmt.move a✝ IH✝) v T).Tape }

Next tactic:
case move _ _ IH => exact TransGen.head rfl (IH _ _)
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    cases' l₁ with l₁; · exact rfl
    simp only [trCfg, TM1.step, FRespects, Option.map]
    induction' M l₁ with _ _ IH _ _ IH _ _ IH generalizing v T
    case move _ _ IH => 

Proof state:
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
l₁ : Λ
a✝ : Dir
IH✝ : Stmt₁
IH :
  ∀ (v : σ) (T : Tape Γ),
    Reaches₁ (TM0.step (tr M)) { q := (some IH✝, v), Tape := T }
      {
        q :=
          (match (TM1.stepAux IH✝ v T).l with
            | some x => some (M x)
            | none => none,
            (TM1.stepAux IH✝ v T).var),
        Tape := (TM1.stepAux IH✝ v T).Tape }
v : σ
T : Tape Γ
⊢ Reaches₁ (TM0.step (tr M)) { q := (some (TM1.Stmt.move a✝ IH✝), v), Tape := T }
    {
      q :=
        (match (TM1.stepAux (TM1.Stmt.move a✝ IH✝) v T).l with
          | some x => some (M x)
          | none => none,
          (TM1.stepAux (TM1.Stmt.move a✝ IH✝) v T).var),
      Tape := (TM1.stepAux (TM1.Stmt.move a✝ IH✝) v T).Tape }

Next tactic:
exact TransGen.head rfl (IH _ _)
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    cases' l₁ with l₁; · exact rfl
    simp only [trCfg, TM1.step, FRespects, Option.map]
    induction' M l₁ with _ _ IH _ _ IH _ _ IH generalizing v T
    case move _ _ IH => exact TransGen.head rfl (IH _ _)
    

Proof state:
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
l₁ : Λ
a✝ : Γ → σ → Γ
IH✝ : Stmt₁
IH :
  ∀ (v : σ) (T : Tape Γ),
    Reaches₁ (TM0.step (tr M)) { q := (some IH✝, v), Tape := T }
      {
        q :=
          (match (TM1.stepAux IH✝ v T).l with
            | some x => some (M x)
            | none => none,
            (TM1.stepAux IH✝ v T).var),
        Tape := (TM1.stepAux IH✝ v T).Tape }
v : σ
T : Tape Γ
⊢ Reaches₁ (TM0.step (tr M)) { q := (some (TM1.Stmt.write a✝ IH✝), v), Tape := T }
    {
      q :=
        (match (TM1.stepAux (TM1.Stmt.write a✝ IH✝) v T).l with
          | some x => some (M x)
          | none => none,
          (TM1.stepAux (TM1.Stmt.write a✝ IH✝) v T).var),
      Tape := (TM1.stepAux (TM1.Stmt.write a✝ IH✝) v T).Tape }

Next tactic:
case write _ _ IH => exact TransGen.head rfl (IH _ _)
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    cases' l₁ with l₁; · exact rfl
    simp only [trCfg, TM1.step, FRespects, Option.map]
    induction' M l₁ with _ _ IH _ _ IH _ _ IH generalizing v T
    case move _ _ IH => exact TransGen.head rfl (IH _ _)
    case write _ _ IH => 

Proof state:
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
l₁ : Λ
a✝ : Γ → σ → Γ
IH✝ : Stmt₁
IH :
  ∀ (v : σ) (T : Tape Γ),
    Reaches₁ (TM0.step (tr M)) { q := (some IH✝, v), Tape := T }
      {
        q :=
          (match (TM1.stepAux IH✝ v T).l with
            | some x => some (M x)
            | none => none,
            (TM1.stepAux IH✝ v T).var),
        Tape := (TM1.stepAux IH✝ v T).Tape }
v : σ
T : Tape Γ
⊢ Reaches₁ (TM0.step (tr M)) { q := (some (TM1.Stmt.write a✝ IH✝), v), Tape := T }
    {
      q :=
        (match (TM1.stepAux (TM1.Stmt.write a✝ IH✝) v T).l with
          | some x => some (M x)
          | none => none,
          (TM1.stepAux (TM1.Stmt.write a✝ IH✝) v T).var),
      Tape := (TM1.stepAux (TM1.Stmt.write a✝ IH✝) v T).Tape }

Next tactic:
exact TransGen.head rfl (IH _ _)
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    cases' l₁ with l₁; · exact rfl
    simp only [trCfg, TM1.step, FRespects, Option.map]
    induction' M l₁ with _ _ IH _ _ IH _ _ IH generalizing v T
    case move _ _ IH => exact TransGen.head rfl (IH _ _)
    case write _ _ IH => exact TransGen.head rfl (IH _ _)
    

Proof state:
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
l₁ : Λ
a✝ : Γ → σ → σ
IH✝ : Stmt₁
IH :
  ∀ (v : σ) (T : Tape Γ),
    Reaches₁ (TM0.step (tr M)) { q := (some IH✝, v), Tape := T }
      {
        q :=
          (match (TM1.stepAux IH✝ v T).l with
            | some x => some (M x)
            | none => none,
            (TM1.stepAux IH✝ v T).var),
        Tape := (TM1.stepAux IH✝ v T).Tape }
v : σ
T : Tape Γ
⊢ Reaches₁ (TM0.step (tr M)) { q := (some (TM1.Stmt.load a✝ IH✝), v), Tape := T }
    {
      q :=
        (match (TM1.stepAux (TM1.Stmt.load a✝ IH✝) v T).l with
          | some x => some (M x)
          | none => none,
          (TM1.stepAux (TM1.Stmt.load a✝ IH✝) v T).var),
      Tape := (TM1.stepAux (TM1.Stmt.load a✝ IH✝) v T).Tape }

Next tactic:
case load _ _ IH => exact (reaches₁_eq (by rfl)).2 (IH _ _)
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    cases' l₁ with l₁; · exact rfl
    simp only [trCfg, TM1.step, FRespects, Option.map]
    induction' M l₁ with _ _ IH _ _ IH _ _ IH generalizing v T
    case move _ _ IH => exact TransGen.head rfl (IH _ _)
    case write _ _ IH => exact TransGen.head rfl (IH _ _)
    case load _ _ IH => 

Proof state:
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
l₁ : Λ
a✝ : Γ → σ → σ
IH✝ : Stmt₁
IH :
  ∀ (v : σ) (T : Tape Γ),
    Reaches₁ (TM0.step (tr M)) { q := (some IH✝, v), Tape := T }
      {
        q :=
          (match (TM1.stepAux IH✝ v T).l with
            | some x => some (M x)
            | none => none,
            (TM1.stepAux IH✝ v T).var),
        Tape := (TM1.stepAux IH✝ v T).Tape }
v : σ
T : Tape Γ
⊢ Reaches₁ (TM0.step (tr M)) { q := (some (TM1.Stmt.load a✝ IH✝), v), Tape := T }
    {
      q :=
        (match (TM1.stepAux (TM1.Stmt.load a✝ IH✝) v T).l with
          | some x => some (M x)
          | none => none,
          (TM1.stepAux (TM1.Stmt.load a✝ IH✝) v T).var),
      Tape := (TM1.stepAux (TM1.Stmt.load a✝ IH✝) v T).Tape }

Next tactic:
exact (reaches₁_eq (by rfl)).2 (IH _ _)
theorem tr_respects :
    Respects (TM1.step M) (TM0.step (tr M)) fun (c₁ : Cfg₁) (c₂ : Cfg₁₀) ↦ trCfg M c₁ = c₂ :=
  fun_respects.2 fun ⟨l₁, v, T⟩ ↦ by
    cases' l₁ with l₁; · exact rfl
    simp only [trCfg, TM1.step, FRespects, Option.map]
    induction' M l₁ with _ _ IH _ _ IH _ _ IH generalizing v T
    case move _ _ IH => exact TransGen.head rfl (IH _ _)
    case write _ _ IH => exact TransGen.head rfl (IH _ _)
    case load _ _ IH => exact (reaches₁_eq (by 

Proof state:
Γ : Type u_1
inst✝² : Inhabited Γ
Λ : Type u_2
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₁
x✝ : Cfg₁
l₁ : Λ
a✝ : Γ → σ → σ
IH✝ : Stmt₁
IH :
  ∀ (v : σ) (T : Tape Γ),
    Reaches₁ (TM0.step (tr M)) { q := (some IH✝, v), Tape := T }
      {
        q :=
          (match (TM1.stepAux IH✝ v T).l with
            | some x => some (M x)
            | none => none,
            (TM1.stepAux IH✝ v T).var),
        Tape := (TM1.stepAux IH✝ v T).Tape }
v : σ
T : Tape Γ
⊢ TM0.step (tr M) { q := (some (TM1.Stmt.load a✝ IH✝), v), Tape := T } =
    TM0.step (tr M) { q := (some IH✝, a✝ T.head v), Tape := T }

Next tactic:
rfl