Theorem: Turing.TM0.Machine.map_respects
File: Mathlib/Computability/TuringMachine.lean

tactic: intro c _ ⟨cs, rfl⟩
state_before: Γ : Type u_3
inst✝³ : Inhabited Γ
Γ' : Type u_4
inst✝² : Inhabited Γ'
Λ : Type u_1
inst✝¹ : Inhabited Λ
Λ' : Type u_2
inst✝ : Inhabited Λ'
M : Machine Γ Λ
f₁ : PointedMap Γ Γ'
f₂ : PointedMap Γ' Γ
g₁✝ : Λ → Λ'
g₂✝ : Λ' → Λ
g₁ : PointedMap Λ Λ'
g₂ : Λ' → Λ
S : Set Λ
ss : Supports M S
f₂₁ : Function.RightInverse f₁.f f₂.f
g₂₁ : ∀ (q : Λ), q ∈ S → g₂ (PointedMap.f g₁ q) = q
⊢ Respects (step M) (step (map M f₁ f₂ g₁.f g₂)) fun a b => a.q ∈ S ∧ Cfg.map f₁ g₁.f a = b

tactic: cases e : step M c
state_before: Γ : Type u_3
inst✝³ : Inhabited Γ
Γ' : Type u_4
inst✝² : Inhabited Γ'
Λ : Type u_1
inst✝¹ : Inhabited Λ
Λ' : Type u_2
inst✝ : Inhabited Λ'
M : Machine Γ Λ
f₁ : PointedMap Γ Γ'
f₂ : PointedMap Γ' Γ
g₁✝ : Λ → Λ'
g₂✝ : Λ' → Λ
g₁ : PointedMap Λ Λ'
g₂ : Λ' → Λ
S : Set Λ
ss : Supports M S
f₂₁ : Function.RightInverse f₁.f f₂.f
g₂₁ : ∀ (q : Λ), q ∈ S → g₂ (PointedMap.f g₁ q) = q
c : Cfg Γ Λ
a₂✝ : Cfg Γ' Λ'
cs : c.q ∈ S
⊢ match step M c with
  | some b₁ =>
    ∃ b₂,
      (fun a b => a.q ∈ S ∧ Cfg.map f₁ g₁.f a = b) b₁ b₂ ∧ Reaches₁ (step (map M f₁ f₂ g₁.f g₂)) (Cfg.map f₁ g₁.f c) b₂
  | none => step (map M f₁ f₂ g₁.f g₂) (Cfg.map f₁ g₁.f c) = none

tactic: rw [← M.map_step f₁ f₂ g₁ g₂ f₂₁ g₂₁ _ cs, e]
state_before: case none
Γ : Type u_3
inst✝³ : Inhabited Γ
Γ' : Type u_4
inst✝² : Inhabited Γ'
Λ : Type u_1
inst✝¹ : Inhabited Λ
Λ' : Type u_2
inst✝ : Inhabited Λ'
M : Machine Γ Λ
f₁ : PointedMap Γ Γ'
f₂ : PointedMap Γ' Γ
g₁✝ : Λ → Λ'
g₂✝ : Λ' → Λ
g₁ : PointedMap Λ Λ'
g₂ : Λ' → Λ
S : Set Λ
ss : Supports M S
f₂₁ : Function.RightInverse f₁.f f₂.f
g₂₁ : ∀ (q : Λ), q ∈ S → g₂ (PointedMap.f g₁ q) = q
c : Cfg Γ Λ
a₂✝ : Cfg Γ' Λ'
cs : c.q ∈ S
e : step M c = none
⊢ match none with
  | some b₁ =>
    ∃ b₂,
      (fun a b => a.q ∈ S ∧ Cfg.map f₁ g₁.f a = b) b₁ b₂ ∧ Reaches₁ (step (map M f₁ f₂ g₁.f g₂)) (Cfg.map f₁ g₁.f c) b₂
  | none => step (map M f₁ f₂ g₁.f g₂) (Cfg.map f₁ g₁.f c) = none

tactic: rfl
state_before: case none
Γ : Type u_3
inst✝³ : Inhabited Γ
Γ' : Type u_4
inst✝² : Inhabited Γ'
Λ : Type u_1
inst✝¹ : Inhabited Λ
Λ' : Type u_2
inst✝ : Inhabited Λ'
M : Machine Γ Λ
f₁ : PointedMap Γ Γ'
f₂ : PointedMap Γ' Γ
g₁✝ : Λ → Λ'
g₂✝ : Λ' → Λ
g₁ : PointedMap Λ Λ'
g₂ : Λ' → Λ
S : Set Λ
ss : Supports M S
f₂₁ : Function.RightInverse f₁.f f₂.f
g₂₁ : ∀ (q : Λ), q ∈ S → g₂ (PointedMap.f g₁ q) = q
c : Cfg Γ Λ
a₂✝ : Cfg Γ' Λ'
cs : c.q ∈ S
e : step M c = none
⊢ match none with
  | some b₁ =>
    ∃ b₂,
      (fun a b => a.q ∈ S ∧ Cfg.map f₁ g₁.f a = b) b₁ b₂ ∧ Reaches₁ (step (map M f₁ f₂ g₁.f g₂)) (Cfg.map f₁ g₁.f c) b₂
  | none => Option.map (Cfg.map f₁ g₁.f) none = none

tactic: refine' ⟨_, ⟨step_supports M ss e cs, rfl⟩, TransGen.single _⟩
state_before: case some
Γ : Type u_3
inst✝³ : Inhabited Γ
Γ' : Type u_4
inst✝² : Inhabited Γ'
Λ : Type u_1
inst✝¹ : Inhabited Λ
Λ' : Type u_2
inst✝ : Inhabited Λ'
M : Machine Γ Λ
f₁ : PointedMap Γ Γ'
f₂ : PointedMap Γ' Γ
g₁✝ : Λ → Λ'
g₂✝ : Λ' → Λ
g₁ : PointedMap Λ Λ'
g₂ : Λ' → Λ
S : Set Λ
ss : Supports M S
f₂₁ : Function.RightInverse f₁.f f₂.f
g₂₁ : ∀ (q : Λ), q ∈ S → g₂ (PointedMap.f g₁ q) = q
c : Cfg Γ Λ
a₂✝ : Cfg Γ' Λ'
cs : c.q ∈ S
val✝ : Cfg Γ Λ
e : step M c = some val✝
⊢ match some val✝ with
  | some b₁ =>
    ∃ b₂,
      (fun a b => a.q ∈ S ∧ Cfg.map f₁ g₁.f a = b) b₁ b₂ ∧ Reaches₁ (step (map M f₁ f₂ g₁.f g₂)) (Cfg.map f₁ g₁.f c) b₂
  | none => step (map M f₁ f₂ g₁.f g₂) (Cfg.map f₁ g₁.f c) = none

tactic: rw [← M.map_step f₁ f₂ g₁ g₂ f₂₁ g₂₁ _ cs, e]
state_before: case some
Γ : Type u_3
inst✝³ : Inhabited Γ
Γ' : Type u_4
inst✝² : Inhabited Γ'
Λ : Type u_1
inst✝¹ : Inhabited Λ
Λ' : Type u_2
inst✝ : Inhabited Λ'
M : Machine Γ Λ
f₁ : PointedMap Γ Γ'
f₂ : PointedMap Γ' Γ
g₁✝ : Λ → Λ'
g₂✝ : Λ' → Λ
g₁ : PointedMap Λ Λ'
g₂ : Λ' → Λ
S : Set Λ
ss : Supports M S
f₂₁ : Function.RightInverse f₁.f f₂.f
g₂₁ : ∀ (q : Λ), q ∈ S → g₂ (PointedMap.f g₁ q) = q
c : Cfg Γ Λ
a₂✝ : Cfg Γ' Λ'
cs : c.q ∈ S
val✝ : Cfg Γ Λ
e : step M c = some val✝
⊢ Cfg.map f₁ g₁.f val✝ ∈ step (map M f₁ f₂ g₁.f g₂) (Cfg.map f₁ g₁.f c)

tactic: rfl
state_before: case some
Γ : Type u_3
inst✝³ : Inhabited Γ
Γ' : Type u_4
inst✝² : Inhabited Γ'
Λ : Type u_1
inst✝¹ : Inhabited Λ
Λ' : Type u_2
inst✝ : Inhabited Λ'
M : Machine Γ Λ
f₁ : PointedMap Γ Γ'
f₂ : PointedMap Γ' Γ
g₁✝ : Λ → Λ'
g₂✝ : Λ' → Λ
g₁ : PointedMap Λ Λ'
g₂ : Λ' → Λ
S : Set Λ
ss : Supports M S
f₂₁ : Function.RightInverse f₁.f f₂.f
g₂₁ : ∀ (q : Λ), q ∈ S → g₂ (PointedMap.f g₁ q) = q
c : Cfg Γ Λ
a₂✝ : Cfg Γ' Λ'
cs : c.q ∈ S
val✝ : Cfg Γ Λ
e : step M c = some val✝
⊢ Cfg.map f₁ g₁.f val✝ ∈ Option.map (Cfg.map f₁ g₁.f) (some val✝)