Theorem: Turing.TM2to1.tr_eval
File: Mathlib/Computability/TuringMachine.lean

tactic: obtain ⟨c₁, h₁, rfl⟩ := (Part.mem_map_iff _).1 H₁
state_before: K : Type u_2
inst✝² : DecidableEq K
Γ : K → Type u_1
Λ : Type u_4
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₂
k : K
L : List (Γ k)
L₁ : ListBlank Γ'
L₂ : List (Γ k)
H₁ : L₁ ∈ TM1.eval (tr M) (trInit k L)
H₂ : L₂ ∈ TM2.eval M k L
⊢ ∃ S L',
    addBottom L' = L₁ ∧
      (∀ (k : K), ListBlank.map (proj k) L' = ListBlank.mk (List.reverse (List.map some (S k)))) ∧ S k = L₂

tactic: obtain ⟨c₂, h₂, rfl⟩ := (Part.mem_map_iff _).1 H₂
state_before: case intro.intro
K : Type u_2
inst✝² : DecidableEq K
Γ : K → Type u_1
Λ : Type u_4
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₂
k : K
L L₂ : List (Γ k)
H₂ : L₂ ∈ TM2.eval M k L
c₁ : TM1.Cfg Γ' Λ' σ
h₁ : c₁ ∈ eval (TM1.step (tr M)) (TM1.init (trInit k L))
H₁ : Tape.right₀ c₁.Tape ∈ TM1.eval (tr M) (trInit k L)
⊢ ∃ S L',
    addBottom L' = Tape.right₀ c₁.Tape ∧
      (∀ (k : K), ListBlank.map (proj k) L' = ListBlank.mk (List.reverse (List.map some (S k)))) ∧ S k = L₂

tactic: obtain ⟨_, ⟨L', hT⟩, h₃⟩ := Turing.tr_eval (tr_respects M) (trCfg_init k L) h₂
state_before: case intro.intro.intro.intro
K : Type u_2
inst✝² : DecidableEq K
Γ : K → Type u_1
Λ : Type u_4
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₂
k : K
L : List (Γ k)
c₁ : TM1.Cfg Γ' Λ' σ
h₁ : c₁ ∈ eval (TM1.step (tr M)) (TM1.init (trInit k L))
H₁ : Tape.right₀ c₁.Tape ∈ TM1.eval (tr M) (trInit k L)
c₂ : Cfg₂
h₂ : c₂ ∈ eval (TM2.step M) (TM2.init k L)
H₂ : TM2.Cfg.stk c₂ k ∈ TM2.eval M k L
⊢ ∃ S L',
    addBottom L' = Tape.right₀ c₁.Tape ∧
      (∀ (k : K), ListBlank.map (proj k) L' = ListBlank.mk (List.reverse (List.map some (S k)))) ∧
        S k = TM2.Cfg.stk c₂ k

tactic: cases Part.mem_unique h₁ h₃
state_before: case intro.intro.intro.intro.intro.intro.mk
K : Type u_2
inst✝² : DecidableEq K
Γ : K → Type u_1
Λ : Type u_4
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₂
k : K
L : List (Γ k)
c₁ : TM1.Cfg Γ' Λ' σ
h₁ : c₁ ∈ eval (TM1.step (tr M)) (TM1.init (trInit k L))
H₁ : Tape.right₀ c₁.Tape ∈ TM1.eval (tr M) (trInit k L)
q✝ : Option Λ
v✝ : σ
S✝ : (k : K) → List (Γ k)
L' : ListBlank ((k : K) → Option (Γ k))
hT : ∀ (k : K), ListBlank.map (proj k) L' = ListBlank.mk (List.reverse (List.map some (S✝ k)))
h₂ : { l := q✝, var := v✝, stk := S✝ } ∈ eval (TM2.step M) (TM2.init k L)
H₂ : TM2.Cfg.stk { l := q✝, var := v✝, stk := S✝ } k ∈ TM2.eval M k L
h₃ :
  { l := Option.map normal q✝, var := v✝, Tape := Tape.mk' ∅ (addBottom L') } ∈
    eval (TM1.step (tr M)) (TM1.init (trInit k L))
⊢ ∃ S L',
    addBottom L' = Tape.right₀ c₁.Tape ∧
      (∀ (k : K), ListBlank.map (proj k) L' = ListBlank.mk (List.reverse (List.map some (S k)))) ∧
        S k = TM2.Cfg.stk { l := q✝, var := v✝, stk := S✝ } k

tactic: exact ⟨_, L', by simp only [Tape.mk'_right₀], hT, rfl⟩
state_before: case intro.intro.intro.intro.intro.intro.mk.refl
K : Type u_2
inst✝² : DecidableEq K
Γ : K → Type u_1
Λ : Type u_4
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₂
k : K
L : List (Γ k)
q✝ : Option Λ
v✝ : σ
S✝ : (k : K) → List (Γ k)
L' : ListBlank ((k : K) → Option (Γ k))
hT : ∀ (k : K), ListBlank.map (proj k) L' = ListBlank.mk (List.reverse (List.map some (S✝ k)))
h₂ : { l := q✝, var := v✝, stk := S✝ } ∈ eval (TM2.step M) (TM2.init k L)
H₂ : TM2.Cfg.stk { l := q✝, var := v✝, stk := S✝ } k ∈ TM2.eval M k L
h₃ :
  { l := Option.map normal q✝, var := v✝, Tape := Tape.mk' ∅ (addBottom L') } ∈
    eval (TM1.step (tr M)) (TM1.init (trInit k L))
h₁ :
  { l := Option.map normal q✝, var := v✝, Tape := Tape.mk' ∅ (addBottom L') } ∈
    eval (TM1.step (tr M)) (TM1.init (trInit k L))
H₁ :
  Tape.right₀ { l := Option.map normal q✝, var := v✝, Tape := Tape.mk' ∅ (addBottom L') }.Tape ∈
    TM1.eval (tr M) (trInit k L)
⊢ ∃ S L'_1,
    addBottom L'_1 = Tape.right₀ { l := Option.map normal q✝, var := v✝, Tape := Tape.mk' ∅ (addBottom L') }.Tape ∧
      (∀ (k : K), ListBlank.map (proj k) L'_1 = ListBlank.mk (List.reverse (List.map some (S k)))) ∧
        S k = TM2.Cfg.stk { l := q✝, var := v✝, stk := S✝ } k

tactic: simp only [Tape.mk'_right₀]
state_before: K : Type u_2
inst✝² : DecidableEq K
Γ : K → Type u_1
Λ : Type u_4
inst✝¹ : Inhabited Λ
σ : Type u_3
inst✝ : Inhabited σ
M : Λ → Stmt₂
k : K
L : List (Γ k)
q✝ : Option Λ
v✝ : σ
S✝ : (k : K) → List (Γ k)
L' : ListBlank ((k : K) → Option (Γ k))
hT : ∀ (k : K), ListBlank.map (proj k) L' = ListBlank.mk (List.reverse (List.map some (S✝ k)))
h₂ : { l := q✝, var := v✝, stk := S✝ } ∈ eval (TM2.step M) (TM2.init k L)
H₂ : TM2.Cfg.stk { l := q✝, var := v✝, stk := S✝ } k ∈ TM2.eval M k L
h₃ :
  { l := Option.map normal q✝, var := v✝, Tape := Tape.mk' ∅ (addBottom L') } ∈
    eval (TM1.step (tr M)) (TM1.init (trInit k L))
h₁ :
  { l := Option.map normal q✝, var := v✝, Tape := Tape.mk' ∅ (addBottom L') } ∈
    eval (TM1.step (tr M)) (TM1.init (trInit k L))
H₁ :
  Tape.right₀ { l := Option.map normal q✝, var := v✝, Tape := Tape.mk' ∅ (addBottom L') }.Tape ∈
    TM1.eval (tr M) (trInit k L)
⊢ addBottom L' = Tape.right₀ { l := Option.map normal q✝, var := v✝, Tape := Tape.mk' ∅ (addBottom L') }.Tape