Theorem: Turing.PartrecToTM2.codeSupp'_supports
File: Mathlib/Computability/TMToPartrec.lean

tactic: induction c generalizing k
state_before: S : Finset Λ'
c : Code
k : Cont'
H : codeSupp c k ⊆ S
⊢ Supports (codeSupp' c k) S

tactic: iterate 3
  exact trStmts₁_supports (trNormal_supports H) (Finset.Subset.trans (codeSupp_self _ _) H)
state_before: case zero'
S : Finset Λ'
k : Cont'
H : codeSupp Code.zero' k ⊆ S
⊢ Supports (codeSupp' Code.zero' k) S

case succ
S : Finset Λ'
k : Cont'
H : codeSupp Code.succ k ⊆ S
⊢ Supports (codeSupp' Code.succ k) S

case tail
S : Finset Λ'
k : Cont'
H : codeSupp Code.tail k ⊆ S
⊢ Supports (codeSupp' Code.tail k) S

case cons
S : Finset Λ'
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {k : Cont'}, codeSupp a✝¹ k ⊆ S → Supports (codeSupp' a✝¹ k) S
a_ih✝ : ∀ {k : Cont'}, codeSupp a✝ k ⊆ S → Supports (codeSupp' a✝ k) S
k : Cont'
H : codeSupp (Code.cons a✝¹ a✝) k ⊆ S
⊢ Supports (codeSupp' (Code.cons a✝¹ a✝) k) S

case comp
S : Finset Λ'
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {k : Cont'}, codeSupp a✝¹ k ⊆ S → Supports (codeSupp' a✝¹ k) S
a_ih✝ : ∀ {k : Cont'}, codeSupp a✝ k ⊆ S → Supports (codeSupp' a✝ k) S
k : Cont'
H : codeSupp (Code.comp a✝¹ a✝) k ⊆ S
⊢ Supports (codeSupp' (Code.comp a✝¹ a✝) k) S

case case
S : Finset Λ'
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {k : Cont'}, codeSupp a✝¹ k ⊆ S → Supports (codeSupp' a✝¹ k) S
a_ih✝ : ∀ {k : Cont'}, codeSupp a✝ k ⊆ S → Supports (codeSupp' a✝ k) S
k : Cont'
H : codeSupp (Code.case a✝¹ a✝) k ⊆ S
⊢ Supports (codeSupp' (Code.case a✝¹ a✝) k) S

case fix
S : Finset Λ'
a✝ : Code
a_ih✝ : ∀ {k : Cont'}, codeSupp a✝ k ⊆ S → Supports (codeSupp' a✝ k) S
k : Cont'
H : codeSupp (Code.fix a✝) k ⊆ S
⊢ Supports (codeSupp' (Code.fix a✝) k) S

tactic: case case f g IHf IHg =>
  have H' := H; simp only [codeSupp_case, Finset.union_subset_iff] at H'
  refine' trStmts₁_supports' (trNormal_supports H) (Finset.union_subset_left H) fun _ => _
  exact supports_union.2 ⟨IHf H'.2.1, IHg H'.2.2⟩
state_before: case case
S : Finset Λ'
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {k : Cont'}, codeSupp a✝¹ k ⊆ S → Supports (codeSupp' a✝¹ k) S
a_ih✝ : ∀ {k : Cont'}, codeSupp a✝ k ⊆ S → Supports (codeSupp' a✝ k) S
k : Cont'
H : codeSupp (Code.case a✝¹ a✝) k ⊆ S
⊢ Supports (codeSupp' (Code.case a✝¹ a✝) k) S

case fix
S : Finset Λ'
a✝ : Code
a_ih✝ : ∀ {k : Cont'}, codeSupp a✝ k ⊆ S → Supports (codeSupp' a✝ k) S
k : Cont'
H : codeSupp (Code.fix a✝) k ⊆ S
⊢ Supports (codeSupp' (Code.fix a✝) k) S

tactic: exact trStmts₁_supports (trNormal_supports H) (Finset.Subset.trans (codeSupp_self _ _) H)
state_before: case tail
S : Finset Λ'
k : Cont'
H : codeSupp Code.tail k ⊆ S
⊢ Supports (codeSupp' Code.tail k) S

case cons
S : Finset Λ'
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {k : Cont'}, codeSupp a✝¹ k ⊆ S → Supports (codeSupp' a✝¹ k) S
a_ih✝ : ∀ {k : Cont'}, codeSupp a✝ k ⊆ S → Supports (codeSupp' a✝ k) S
k : Cont'
H : codeSupp (Code.cons a✝¹ a✝) k ⊆ S
⊢ Supports (codeSupp' (Code.cons a✝¹ a✝) k) S

case comp
S : Finset Λ'
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {k : Cont'}, codeSupp a✝¹ k ⊆ S → Supports (codeSupp' a✝¹ k) S
a_ih✝ : ∀ {k : Cont'}, codeSupp a✝ k ⊆ S → Supports (codeSupp' a✝ k) S
k : Cont'
H : codeSupp (Code.comp a✝¹ a✝) k ⊆ S
⊢ Supports (codeSupp' (Code.comp a✝¹ a✝) k) S

case case
S : Finset Λ'
a✝¹ a✝ : Code
a_ih✝¹ : ∀ {k : Cont'}, codeSupp a✝¹ k ⊆ S → Supports (codeSupp' a✝¹ k) S
a_ih✝ : ∀ {k : Cont'}, codeSupp a✝ k ⊆ S → Supports (codeSupp' a✝ k) S
k : Cont'
H : codeSupp (Code.case a✝¹ a✝) k ⊆ S
⊢ Supports (codeSupp' (Code.case a✝¹ a✝) k) S

case fix
S : Finset Λ'
a✝ : Code
a_ih✝ : ∀ {k : Cont'}, codeSupp a✝ k ⊆ S → Supports (codeSupp' a✝ k) S
k : Cont'
H : codeSupp (Code.fix a✝) k ⊆ S
⊢ Supports (codeSupp' (Code.fix a✝) k) S

tactic: have H' := H
state_before: S : Finset Λ'
f fs : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHfs : ∀ {k : Cont'}, codeSupp fs k ⊆ S → Supports (codeSupp' fs k) S
k : Cont'
H : codeSupp (Code.cons f fs) k ⊆ S
⊢ Supports (codeSupp' (Code.cons f fs) k) S

tactic: simp only [codeSupp_cons, Finset.union_subset_iff] at H'
state_before: S : Finset Λ'
f fs : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHfs : ∀ {k : Cont'}, codeSupp fs k ⊆ S → Supports (codeSupp' fs k) S
k : Cont'
H H' : codeSupp (Code.cons f fs) k ⊆ S
⊢ Supports (codeSupp' (Code.cons f fs) k) S

tactic: refine' trStmts₁_supports' (trNormal_supports H) (Finset.union_subset_left H) fun h => _
state_before: S : Finset Λ'
f fs : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHfs : ∀ {k : Cont'}, codeSupp fs k ⊆ S → Supports (codeSupp' fs k) S
k : Cont'
H : codeSupp (Code.cons f fs) k ⊆ S
H' : trStmts₁ (trNormal (Code.cons f fs) k) ⊆ S ∧ codeSupp f (Cont'.cons₁ fs k) ⊆ S
⊢ Supports (codeSupp' (Code.cons f fs) k) S

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

tactic: refine' trStmts₁_supports' (trNormal_supports _) (Finset.union_subset_right h) fun h => _
state_before: S : Finset Λ'
f fs : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHfs : ∀ {k : Cont'}, codeSupp fs k ⊆ S → Supports (codeSupp' fs k) S
k : Cont'
H : codeSupp (Code.cons f fs) k ⊆ S
H' : trStmts₁ (trNormal (Code.cons f fs) k) ⊆ S ∧ codeSupp f (Cont'.cons₁ fs k) ⊆ S
h :
  codeSupp' f (Cont'.cons₁ fs k) ∪
      (trStmts₁
          (move₂ (fun x => false) main aux
            (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
              (move₂ (fun x => false) aux stack (trNormal fs (Cont'.cons₂ k))))) ∪
        (codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k)))) ⊆
    S
⊢ Supports
    (trStmts₁
        (move₂ (fun x => false) main aux
          (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
            (move₂ (fun x => false) aux stack (trNormal fs (Cont'.cons₂ k))))) ∪
      (codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k))))
    S

tactic: refine' supports_union.2 ⟨IHfs _, _⟩
state_before: case refine'_2
S : Finset Λ'
f fs : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHfs : ∀ {k : Cont'}, codeSupp fs k ⊆ S → Supports (codeSupp' fs k) S
k : Cont'
H : codeSupp (Code.cons f fs) k ⊆ S
H' : trStmts₁ (trNormal (Code.cons f fs) k) ⊆ S ∧ codeSupp f (Cont'.cons₁ fs k) ⊆ S
h✝ :
  codeSupp' f (Cont'.cons₁ fs k) ∪
      (trStmts₁
          (move₂ (fun x => false) main aux
            (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
              (move₂ (fun x => false) aux stack (trNormal fs (Cont'.cons₂ k))))) ∪
        (codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k)))) ⊆
    S
h : codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k)) ⊆ S
⊢ Supports (codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k))) S

tactic: exact
  trStmts₁_supports (head_supports <| Finset.union_subset_right H)
    (Finset.union_subset_right h)
state_before: case refine'_2.refine'_2
S : Finset Λ'
f fs : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHfs : ∀ {k : Cont'}, codeSupp fs k ⊆ S → Supports (codeSupp' fs k) S
k : Cont'
H : codeSupp (Code.cons f fs) k ⊆ S
H' : trStmts₁ (trNormal (Code.cons f fs) k) ⊆ S ∧ codeSupp f (Cont'.cons₁ fs k) ⊆ S
h✝ :
  codeSupp' f (Cont'.cons₁ fs k) ∪
      (trStmts₁
          (move₂ (fun x => false) main aux
            (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
              (move₂ (fun x => false) aux stack (trNormal fs (Cont'.cons₂ k))))) ∪
        (codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k)))) ⊆
    S
h : codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k)) ⊆ S
⊢ Supports (trStmts₁ (head stack (Λ'.ret k))) S

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

tactic: exact ⟨h.2.2.1, h.2.2.2, H.2⟩
state_before: case refine'_1
S : Finset Λ'
f fs : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHfs : ∀ {k : Cont'}, codeSupp fs k ⊆ S → Supports (codeSupp' fs k) S
k : Cont'
H' : trStmts₁ (trNormal (Code.cons f fs) k) ⊆ S ∧ codeSupp f (Cont'.cons₁ fs k) ⊆ S
h :
  codeSupp' f (Cont'.cons₁ fs k) ⊆ S ∧
    trStmts₁
          (move₂ (fun x => false) main aux
            (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
              (move₂ (fun x => false) aux stack (trNormal fs (Cont'.cons₂ k))))) ⊆
        S ∧
      codeSupp' fs (Cont'.cons₂ k) ⊆ S ∧ trStmts₁ (head stack (Λ'.ret k)) ⊆ S
H : codeSupp' (Code.cons f fs) k ⊆ S ∧ contSupp k ⊆ S
⊢ codeSupp' fs (Cont'.cons₂ k) ⊆ S ∧ trStmts₁ (head stack (Λ'.ret k)) ⊆ S ∧ contSupp k ⊆ S

tactic: rw [codeSupp, contSupp_cons₁] at H'
state_before: case refine'_2.refine'_1
S : Finset Λ'
f fs : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHfs : ∀ {k : Cont'}, codeSupp fs k ⊆ S → Supports (codeSupp' fs k) S
k : Cont'
H : codeSupp (Code.cons f fs) k ⊆ S
H' : trStmts₁ (trNormal (Code.cons f fs) k) ⊆ S ∧ codeSupp f (Cont'.cons₁ fs k) ⊆ S
h✝ :
  codeSupp' f (Cont'.cons₁ fs k) ∪
      (trStmts₁
          (move₂ (fun x => false) main aux
            (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
              (move₂ (fun x => false) aux stack (trNormal fs (Cont'.cons₂ k))))) ∪
        (codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k)))) ⊆
    S
h : codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k)) ⊆ S
⊢ codeSupp fs (Cont'.cons₂ k) ⊆ S

tactic: exact Finset.union_subset_right (Finset.union_subset_right H'.2)
state_before: case refine'_2.refine'_1
S : Finset Λ'
f fs : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHfs : ∀ {k : Cont'}, codeSupp fs k ⊆ S → Supports (codeSupp' fs k) S
k : Cont'
H : codeSupp (Code.cons f fs) k ⊆ S
H' :
  trStmts₁ (trNormal (Code.cons f fs) k) ⊆ S ∧
    codeSupp' f (Cont'.cons₁ fs k) ∪
        (trStmts₁
            (move₂ (fun x => false) main aux
              (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
                (move₂ (fun x => false) aux stack (trNormal fs (Cont'.cons₂ k))))) ∪
          codeSupp fs (Cont'.cons₂ k)) ⊆
      S
h✝ :
  codeSupp' f (Cont'.cons₁ fs k) ∪
      (trStmts₁
          (move₂ (fun x => false) main aux
            (move₂ (fun s => decide (s = Γ'.consₗ)) stack main
              (move₂ (fun x => false) aux stack (trNormal fs (Cont'.cons₂ k))))) ∪
        (codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k)))) ⊆
    S
h : codeSupp' fs (Cont'.cons₂ k) ∪ trStmts₁ (head stack (Λ'.ret k)) ⊆ S
⊢ codeSupp fs (Cont'.cons₂ k) ⊆ S

tactic: have H' := H
state_before: S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H : codeSupp (Code.comp f g) k ⊆ S
⊢ Supports (codeSupp' (Code.comp f g) k) S

tactic: rw [codeSupp_comp] at H'
state_before: S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H H' : codeSupp (Code.comp f g) k ⊆ S
⊢ Supports (codeSupp' (Code.comp f g) k) S

tactic: have H' := Finset.union_subset_right H'
state_before: S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H : codeSupp (Code.comp f g) k ⊆ S
H' : trStmts₁ (trNormal (Code.comp f g) k) ∪ codeSupp g (Cont'.comp f k) ⊆ S
⊢ Supports (codeSupp' (Code.comp f g) k) S

tactic: refine' trStmts₁_supports' (trNormal_supports H) (Finset.union_subset_left H) fun h => _
state_before: S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H : codeSupp (Code.comp f g) k ⊆ S
H'✝ : trStmts₁ (trNormal (Code.comp f g) k) ∪ codeSupp g (Cont'.comp f k) ⊆ S
H' : codeSupp g (Cont'.comp f k) ⊆ S
⊢ Supports (codeSupp' (Code.comp f g) k) S

tactic: refine' supports_union.2 ⟨IHg H', _⟩
state_before: S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H : codeSupp (Code.comp f g) k ⊆ S
H'✝ : trStmts₁ (trNormal (Code.comp f g) k) ∪ codeSupp g (Cont'.comp f k) ⊆ S
H' : codeSupp g (Cont'.comp f k) ⊆ S
h : codeSupp' g (Cont'.comp f k) ∪ (trStmts₁ (trNormal f k) ∪ codeSupp' f k) ⊆ S
⊢ Supports (codeSupp' g (Cont'.comp f k) ∪ (trStmts₁ (trNormal f k) ∪ codeSupp' f k)) S

tactic: refine' trStmts₁_supports' (trNormal_supports _) (Finset.union_subset_right h) fun _ => _
state_before: S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H : codeSupp (Code.comp f g) k ⊆ S
H'✝ : trStmts₁ (trNormal (Code.comp f g) k) ∪ codeSupp g (Cont'.comp f k) ⊆ S
H' : codeSupp g (Cont'.comp f k) ⊆ S
h : codeSupp' g (Cont'.comp f k) ∪ (trStmts₁ (trNormal f k) ∪ codeSupp' f k) ⊆ S
⊢ Supports (trStmts₁ (trNormal f k) ∪ codeSupp' f k) S

tactic: exact IHf (Finset.union_subset_right H')
state_before: case refine'_2
S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H : codeSupp (Code.comp f g) k ⊆ S
H'✝ : trStmts₁ (trNormal (Code.comp f g) k) ∪ codeSupp g (Cont'.comp f k) ⊆ S
H' : codeSupp g (Cont'.comp f k) ⊆ S
h : codeSupp' g (Cont'.comp f k) ∪ (trStmts₁ (trNormal f k) ∪ codeSupp' f k) ⊆ S
x✝ : codeSupp' f k ⊆ S
⊢ Supports (codeSupp' f k) S

tactic: simp only [codeSupp', codeSupp, Finset.union_subset_iff, contSupp] at h H⊢
state_before: case refine'_1
S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H : codeSupp (Code.comp f g) k ⊆ S
H'✝ : trStmts₁ (trNormal (Code.comp f g) k) ∪ codeSupp g (Cont'.comp f k) ⊆ S
H' : codeSupp g (Cont'.comp f k) ⊆ S
h : codeSupp' g (Cont'.comp f k) ∪ (trStmts₁ (trNormal f k) ∪ codeSupp' f k) ⊆ S
⊢ codeSupp f k ⊆ S

tactic: exact ⟨h.2.2, H.2⟩
state_before: case refine'_1
S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H'✝ : trStmts₁ (trNormal (Code.comp f g) k) ∪ codeSupp g (Cont'.comp f k) ⊆ S
H' : codeSupp g (Cont'.comp f k) ⊆ S
h : codeSupp' g (Cont'.comp f k) ⊆ S ∧ trStmts₁ (trNormal f k) ⊆ S ∧ codeSupp' f k ⊆ S
H :
  (trStmts₁ (trNormal (Code.comp f g) k) ⊆ S ∧
      codeSupp' g (Cont'.comp f k) ⊆ S ∧ trStmts₁ (trNormal f k) ⊆ S ∧ codeSupp' f k ⊆ S) ∧
    contSupp k ⊆ S
⊢ codeSupp' f k ⊆ S ∧ contSupp k ⊆ S

tactic: have H' := H
state_before: S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H : codeSupp (Code.case f g) k ⊆ S
⊢ Supports (codeSupp' (Code.case f g) k) S

tactic: simp only [codeSupp_case, Finset.union_subset_iff] at H'
state_before: S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H H' : codeSupp (Code.case f g) k ⊆ S
⊢ Supports (codeSupp' (Code.case f g) k) S

tactic: refine' trStmts₁_supports' (trNormal_supports H) (Finset.union_subset_left H) fun _ => _
state_before: S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H : codeSupp (Code.case f g) k ⊆ S
H' : trStmts₁ (trNormal (Code.case f g) k) ⊆ S ∧ codeSupp f k ⊆ S ∧ codeSupp g k ⊆ S
⊢ Supports (codeSupp' (Code.case f g) k) S

tactic: exact supports_union.2 ⟨IHf H'.2.1, IHg H'.2.2⟩
state_before: S : Finset Λ'
f g : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
IHg : ∀ {k : Cont'}, codeSupp g k ⊆ S → Supports (codeSupp' g k) S
k : Cont'
H : codeSupp (Code.case f g) k ⊆ S
H' : trStmts₁ (trNormal (Code.case f g) k) ⊆ S ∧ codeSupp f k ⊆ S ∧ codeSupp g k ⊆ S
x✝ : codeSupp' f k ∪ codeSupp' g k ⊆ S
⊢ Supports (codeSupp' f k ∪ codeSupp' g k) S

tactic: have H' := H
state_before: S : Finset Λ'
f : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
k : Cont'
H : codeSupp (Code.fix f) k ⊆ S
⊢ Supports (codeSupp' (Code.fix f) k) S

tactic: simp only [codeSupp_fix, Finset.union_subset_iff] at H'
state_before: S : Finset Λ'
f : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
k : Cont'
H H' : codeSupp (Code.fix f) k ⊆ S
⊢ Supports (codeSupp' (Code.fix f) k) S

tactic: refine' trStmts₁_supports' (trNormal_supports H) (Finset.union_subset_left H) fun h => _
state_before: S : Finset Λ'
f : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
k : Cont'
H : codeSupp (Code.fix f) k ⊆ S
H' : trStmts₁ (trNormal (Code.fix f) k) ⊆ S ∧ codeSupp f (Cont'.fix f k) ⊆ S
⊢ Supports (codeSupp' (Code.fix f) k) S

tactic: refine' supports_union.2 ⟨IHf H'.2, _⟩
state_before: S : Finset Λ'
f : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
k : Cont'
H : codeSupp (Code.fix f) k ⊆ S
H' : trStmts₁ (trNormal (Code.fix f) k) ⊆ S ∧ codeSupp f (Cont'.fix f k) ⊆ S
h : codeSupp' f (Cont'.fix f k) ∪ (trStmts₁ (Λ'.clear natEnd main (trNormal f (Cont'.fix f k))) ∪ {Λ'.ret k}) ⊆ S
⊢ Supports (codeSupp' f (Cont'.fix f k) ∪ (trStmts₁ (Λ'.clear natEnd main (trNormal f (Cont'.fix f k))) ∪ {Λ'.ret k})) S

tactic: refine' trStmts₁_supports' (trNormal_supports _) (Finset.union_subset_right h) fun _ => _
state_before: S : Finset Λ'
f : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
k : Cont'
H : codeSupp (Code.fix f) k ⊆ S
H' : trStmts₁ (trNormal (Code.fix f) k) ⊆ S ∧ codeSupp f (Cont'.fix f k) ⊆ S
h : codeSupp' f (Cont'.fix f k) ∪ (trStmts₁ (Λ'.clear natEnd main (trNormal f (Cont'.fix f k))) ∪ {Λ'.ret k}) ⊆ S
⊢ Supports (trStmts₁ (Λ'.clear natEnd main (trNormal f (Cont'.fix f k))) ∪ {Λ'.ret k}) S

tactic: exact supports_singleton.2 (ret_supports <| Finset.union_subset_right H)
state_before: case refine'_2
S : Finset Λ'
f : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
k : Cont'
H : codeSupp (Code.fix f) k ⊆ S
H' : trStmts₁ (trNormal (Code.fix f) k) ⊆ S ∧ codeSupp f (Cont'.fix f k) ⊆ S
h : codeSupp' f (Cont'.fix f k) ∪ (trStmts₁ (Λ'.clear natEnd main (trNormal f (Cont'.fix f k))) ∪ {Λ'.ret k}) ⊆ S
x✝ : {Λ'.ret k} ⊆ S
⊢ Supports {Λ'.ret k} S

tactic: simp only [codeSupp', codeSupp, Finset.union_subset_iff, contSupp, trStmts₁,
  Finset.insert_subset] at h H⊢
state_before: case refine'_1
S : Finset Λ'
f : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
k : Cont'
H : codeSupp (Code.fix f) k ⊆ S
H' : trStmts₁ (trNormal (Code.fix f) k) ⊆ S ∧ codeSupp f (Cont'.fix f k) ⊆ S
h : codeSupp' f (Cont'.fix f k) ∪ (trStmts₁ (Λ'.clear natEnd main (trNormal f (Cont'.fix f k))) ∪ {Λ'.ret k}) ⊆ S
⊢ codeSupp f (Cont'.fix f k) ⊆ S

tactic: exact ⟨h.1, ⟨H.1.1, h⟩, H.2⟩
state_before: case refine'_1
S : Finset Λ'
f : Code
IHf : ∀ {k : Cont'}, codeSupp f k ⊆ S → Supports (codeSupp' f k) S
k : Cont'
H' : trStmts₁ (trNormal (Code.fix f) k) ⊆ S ∧ codeSupp f (Cont'.fix f k) ⊆ S
h :
  codeSupp' f (Cont'.fix f k) ⊆ S ∧
    (Λ'.clear natEnd main (trNormal f (Cont'.fix f k)) ∈ S ∧ trStmts₁ (trNormal f (Cont'.fix f k)) ⊆ S) ∧ {Λ'.ret k} ⊆ S
H :
  (trStmts₁ (trNormal (Code.fix f) k) ⊆ S ∧
      codeSupp' f (Cont'.fix f k) ⊆ S ∧
        (Λ'.clear natEnd main (trNormal f (Cont'.fix f k)) ∈ S ∧ trStmts₁ (trNormal f (Cont'.fix f k)) ⊆ S) ∧
          {Λ'.ret k} ⊆ S) ∧
    contSupp k ⊆ S
⊢ codeSupp' f (Cont'.fix f k) ⊆ S ∧
    (trStmts₁ (trNormal (Code.fix f) k) ⊆ S ∧
        codeSupp' f (Cont'.fix f k) ⊆ S ∧
          (Λ'.clear natEnd main (trNormal f (Cont'.fix f k)) ∈ S ∧ trStmts₁ (trNormal f (Cont'.fix f k)) ⊆ S) ∧
            {Λ'.ret k} ⊆ S) ∧
      contSupp k ⊆ S