Theorem: Turing.PartrecToTM2.contSupp_supports
File: Mathlib/Computability/TMToPartrec.lean

tactic: induction k
state_before: S : Finset Λ'
k : Cont'
H : contSupp k ⊆ S
⊢ Supports (contSupp k) S

tactic: case cons₁ f k IH =>
  have H₁ := H; rw [contSupp_cons₁] at H₁; have H₂ := Finset.union_subset_right H₁
  refine' trStmts₁_supports' (trNormal_supports H₂) H₁ fun h => _
  refine' supports_union.2 ⟨codeSupp'_supports H₂, _⟩
  simp only [codeSupp, contSupp_cons₂, Finset.union_subset_iff] at H₂
  exact trStmts₁_supports' (head_supports H₂.2.2) (Finset.union_subset_right h) IH
state_before: case cons₁
S : Finset Λ'
a✝¹ : Code
a✝ : Cont'
a_ih✝ : contSupp a✝ ⊆ S → Supports (contSupp a✝) S
H : contSupp (Cont'.cons₁ a✝¹ a✝) ⊆ S
⊢ Supports (contSupp (Cont'.cons₁ a✝¹ a✝)) S

case cons₂
S : Finset Λ'
a✝ : Cont'
a_ih✝ : contSupp a✝ ⊆ S → Supports (contSupp a✝) S
H : contSupp (Cont'.cons₂ a✝) ⊆ S
⊢ Supports (contSupp (Cont'.cons₂ a✝)) S

case comp
S : Finset Λ'
a✝¹ : Code
a✝ : Cont'
a_ih✝ : contSupp a✝ ⊆ S → Supports (contSupp a✝) S
H : contSupp (Cont'.comp a✝¹ a✝) ⊆ S
⊢ Supports (contSupp (Cont'.comp a✝¹ a✝)) S

case fix
S : Finset Λ'
a✝¹ : Code
a✝ : Cont'
a_ih✝ : contSupp a✝ ⊆ S → Supports (contSupp a✝) S
H : contSupp (Cont'.fix a✝¹ a✝) ⊆ S
⊢ Supports (contSupp (Cont'.fix a✝¹ a✝)) S

tactic: case cons₂ k IH =>
  have H' := H; rw [contSupp_cons₂] at H'
  exact trStmts₁_supports' (head_supports <| Finset.union_subset_right H') H' IH
state_before: case cons₂
S : Finset Λ'
a✝ : Cont'
a_ih✝ : contSupp a✝ ⊆ S → Supports (contSupp a✝) S
H : contSupp (Cont'.cons₂ a✝) ⊆ S
⊢ Supports (contSupp (Cont'.cons₂ a✝)) S

case comp
S : Finset Λ'
a✝¹ : Code
a✝ : Cont'
a_ih✝ : contSupp a✝ ⊆ S → Supports (contSupp a✝) S
H : contSupp (Cont'.comp a✝¹ a✝) ⊆ S
⊢ Supports (contSupp (Cont'.comp a✝¹ a✝)) S

case fix
S : Finset Λ'
a✝¹ : Code
a✝ : Cont'
a_ih✝ : contSupp a✝ ⊆ S → Supports (contSupp a✝) S
H : contSupp (Cont'.fix a✝¹ a✝) ⊆ S
⊢ Supports (contSupp (Cont'.fix a✝¹ a✝)) S

tactic: case comp f k IH =>
  have H' := H; rw [contSupp_comp] at H'; have H₂ := Finset.union_subset_right H'
  exact supports_union.2 ⟨codeSupp'_supports H', IH H₂⟩
state_before: case comp
S : Finset Λ'
a✝¹ : Code
a✝ : Cont'
a_ih✝ : contSupp a✝ ⊆ S → Supports (contSupp a✝) S
H : contSupp (Cont'.comp a✝¹ a✝) ⊆ S
⊢ Supports (contSupp (Cont'.comp a✝¹ a✝)) S

case fix
S : Finset Λ'
a✝¹ : Code
a✝ : Cont'
a_ih✝ : contSupp a✝ ⊆ S → Supports (contSupp a✝) S
H : contSupp (Cont'.fix a✝¹ a✝) ⊆ S
⊢ Supports (contSupp (Cont'.fix a✝¹ a✝)) S

tactic: case fix f k IH =>
  rw [contSupp] at H
  exact supports_union.2 ⟨codeSupp'_supports H, IH (Finset.union_subset_right H)⟩
state_before: case fix
S : Finset Λ'
a✝¹ : Code
a✝ : Cont'
a_ih✝ : contSupp a✝ ⊆ S → Supports (contSupp a✝) S
H : contSupp (Cont'.fix a✝¹ a✝) ⊆ S
⊢ Supports (contSupp (Cont'.fix a✝¹ a✝)) S

tactic: simp [contSupp_halt, Supports]
state_before: case halt
S : Finset Λ'
H : contSupp Cont'.halt ⊆ S
⊢ Supports (contSupp Cont'.halt) S

tactic: have H₁ := H
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.cons₁ f k) ⊆ S
⊢ Supports (contSupp (Cont'.cons₁ f k)) S

tactic: rw [contSupp_cons₁] at H₁
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H H₁ : contSupp (Cont'.cons₁ f k) ⊆ S
⊢ Supports (contSupp (Cont'.cons₁ f k)) S

tactic: have H₂ := Finset.union_subset_right H₁
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.cons₁ f k) ⊆ S
H₁ :
  trStmts₁
        (move₂ (fun x => false) main aux
          (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
            (move₂ (fun x => false) aux stack (trNormal f (Cont'.cons₂ k))))) ∪
      codeSupp f (Cont'.cons₂ k) ⊆
    S
⊢ Supports (contSupp (Cont'.cons₁ f k)) S

tactic: refine' trStmts₁_supports' (trNormal_supports H₂) H₁ fun h => _
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.cons₁ f k) ⊆ S
H₁ :
  trStmts₁
        (move₂ (fun x => false) main aux
          (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
            (move₂ (fun x => false) aux stack (trNormal f (Cont'.cons₂ k))))) ∪
      codeSupp f (Cont'.cons₂ k) ⊆
    S
H₂ : codeSupp f (Cont'.cons₂ k) ⊆ S
⊢ Supports (contSupp (Cont'.cons₁ f k)) S

tactic: refine' supports_union.2 ⟨codeSupp'_supports H₂, _⟩
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.cons₁ f k) ⊆ S
H₁ :
  trStmts₁
        (move₂ (fun x => false) main aux
          (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
            (move₂ (fun x => false) aux stack (trNormal f (Cont'.cons₂ k))))) ∪
      codeSupp f (Cont'.cons₂ k) ⊆
    S
H₂ : codeSupp f (Cont'.cons₂ k) ⊆ S
h : codeSupp' f (Cont'.cons₂ k) ∪ (trStmts₁ (head stack (Λ'.ret k)) ∪ contSupp k) ⊆ S
⊢ Supports (codeSupp' f (Cont'.cons₂ k) ∪ (trStmts₁ (head stack (Λ'.ret k)) ∪ contSupp k)) S

tactic: simp only [codeSupp, contSupp_cons₂, Finset.union_subset_iff] at H₂
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.cons₁ f k) ⊆ S
H₁ :
  trStmts₁
        (move₂ (fun x => false) main aux
          (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
            (move₂ (fun x => false) aux stack (trNormal f (Cont'.cons₂ k))))) ∪
      codeSupp f (Cont'.cons₂ k) ⊆
    S
H₂ : codeSupp f (Cont'.cons₂ k) ⊆ S
h : codeSupp' f (Cont'.cons₂ k) ∪ (trStmts₁ (head stack (Λ'.ret k)) ∪ contSupp k) ⊆ S
⊢ Supports (trStmts₁ (head stack (Λ'.ret k)) ∪ contSupp k) S

tactic: exact trStmts₁_supports' (head_supports H₂.2.2) (Finset.union_subset_right h) IH
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.cons₁ f k) ⊆ S
H₁ :
  trStmts₁
        (move₂ (fun x => false) main aux
          (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
            (move₂ (fun x => false) aux stack (trNormal f (Cont'.cons₂ k))))) ∪
      codeSupp f (Cont'.cons₂ k) ⊆
    S
h : codeSupp' f (Cont'.cons₂ k) ∪ (trStmts₁ (head stack (Λ'.ret k)) ∪ contSupp k) ⊆ S
H₂ : codeSupp' f (Cont'.cons₂ k) ⊆ S ∧ trStmts₁ (head stack (Λ'.ret k)) ⊆ S ∧ contSupp k ⊆ S
⊢ Supports (trStmts₁ (head stack (Λ'.ret k)) ∪ contSupp k) S

tactic: have H' := H
state_before: S : Finset Λ'
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.cons₂ k) ⊆ S
⊢ Supports (contSupp (Cont'.cons₂ k)) S

tactic: rw [contSupp_cons₂] at H'
state_before: S : Finset Λ'
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H H' : contSupp (Cont'.cons₂ k) ⊆ S
⊢ Supports (contSupp (Cont'.cons₂ k)) S

tactic: exact trStmts₁_supports' (head_supports <| Finset.union_subset_right H') H' IH
state_before: S : Finset Λ'
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.cons₂ k) ⊆ S
H' : trStmts₁ (head stack (Λ'.ret k)) ∪ contSupp k ⊆ S
⊢ Supports (contSupp (Cont'.cons₂ k)) S

tactic: have H' := H
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.comp f k) ⊆ S
⊢ Supports (contSupp (Cont'.comp f k)) S

tactic: rw [contSupp_comp] at H'
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H H' : contSupp (Cont'.comp f k) ⊆ S
⊢ Supports (contSupp (Cont'.comp f k)) S

tactic: have H₂ := Finset.union_subset_right H'
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.comp f k) ⊆ S
H' : codeSupp f k ⊆ S
⊢ Supports (contSupp (Cont'.comp f k)) S

tactic: exact supports_union.2 ⟨codeSupp'_supports H', IH H₂⟩
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.comp f k) ⊆ S
H' : codeSupp f k ⊆ S
H₂ : contSupp k ⊆ S
⊢ Supports (contSupp (Cont'.comp f k)) S

tactic: rw [contSupp] at H
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : contSupp (Cont'.fix f k) ⊆ S
⊢ Supports (contSupp (Cont'.fix f k)) S

tactic: exact supports_union.2 ⟨codeSupp'_supports H, IH (Finset.union_subset_right H)⟩
state_before: S : Finset Λ'
f : Code
k : Cont'
IH : contSupp k ⊆ S → Supports (contSupp k) S
H : codeSupp' (Code.fix f) k ∪ contSupp k ⊆ S
⊢ Supports (contSupp (Cont'.fix f k)) S