theorem tr_supports {S : Finset Λ} (ss : Supports M S) : Supports (tr enc dec M) (trSupp M S) :=
  ⟨Finset.mem_biUnion.2 ⟨_, ss.1, Finset.mem_insert_self _ _⟩, fun q h ↦ by
    suffices ∀ q, SupportsStmt S q → (∀ q' ∈ writes q, q' ∈ trSupp M S) →
        SupportsStmt (trSupp M S) (trNormal dec q) ∧
        ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q') by
      rcases Finset.mem_biUnion.1 h with ⟨l, hl, h⟩
      have :=
        this _ (ss.2 _ hl) fun q' hq ↦ Finset.mem_biUnion.2 ⟨_, hl, Finset.mem_insert_of_mem hq⟩
      rcases Finset.mem_insert.1 h with (rfl | h)
      exacts [this.1, this.2 _ h]
    intro q hs hw
    induction q
    

Proof state:
case move
Γ : Type u_1
inst✝³ : Inhabited Γ
Λ : Type u_2
inst✝² : Inhabited Λ
σ : Type u_3
inst✝¹ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
encdec : ∀ (a : Γ), dec (enc a) = a
inst✝ : Fintype Γ
S : Finset Λ
ss : Supports M S
q : Λ'
h : q ∈ trSupp M S
a✝¹ : Dir
a✝ : Stmt₁
a_ih✝ :
  SupportsStmt S a✝ →
    (∀ q' ∈ writes a✝, q' ∈ trSupp M S) →
      SupportsStmt (trSupp M S) (trNormal dec a✝) ∧ ∀ q' ∈ writes a✝, SupportsStmt (trSupp M S) (tr enc dec M q')
hs : SupportsStmt S (Stmt.move a✝¹ a✝)
hw : ∀ q' ∈ writes (Stmt.move a✝¹ a✝), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.move a✝¹ a✝)) ∧
    ∀ q' ∈ writes (Stmt.move a✝¹ a✝), SupportsStmt (trSupp M S) (tr enc dec M q')
case write
Γ : Type u_1
inst✝³ : Inhabited Γ
Λ : Type u_2
inst✝² : Inhabited Λ
σ : Type u_3
inst✝¹ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
encdec : ∀ (a : Γ), dec (enc a) = a
inst✝ : Fintype Γ
S : Finset Λ
ss : Supports M S
q : Λ'
h : q ∈ trSupp M S
a✝¹ : Γ → σ → Γ
a✝ : Stmt₁
a_ih✝ :
  SupportsStmt S a✝ →
    (∀ q' ∈ writes a✝, q' ∈ trSupp M S) →
      SupportsStmt (trSupp M S) (trNormal dec a✝) ∧ ∀ q' ∈ writes a✝, SupportsStmt (trSupp M S) (tr enc dec M q')
hs : SupportsStmt S (Stmt.write a✝¹ a✝)
hw : ∀ q' ∈ writes (Stmt.write a✝¹ a✝), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.write a✝¹ a✝)) ∧
    ∀ q' ∈ writes (Stmt.write a✝¹ a✝), SupportsStmt (trSupp M S) (tr enc dec M q')
case load
Γ : Type u_1
inst✝³ : Inhabited Γ
Λ : Type u_2
inst✝² : Inhabited Λ
σ : Type u_3
inst✝¹ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
encdec : ∀ (a : Γ), dec (enc a) = a
inst✝ : Fintype Γ
S : Finset Λ
ss : Supports M S
q : Λ'
h : q ∈ trSupp M S
a✝¹ : Γ → σ → σ
a✝ : Stmt₁
a_ih✝ :
  SupportsStmt S a✝ →
    (∀ q' ∈ writes a✝, q' ∈ trSupp M S) →
      SupportsStmt (trSupp M S) (trNormal dec a✝) ∧ ∀ q' ∈ writes a✝, SupportsStmt (trSupp M S) (tr enc dec M q')
hs : SupportsStmt S (Stmt.load a✝¹ a✝)
hw : ∀ q' ∈ writes (Stmt.load a✝¹ a✝), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.load a✝¹ a✝)) ∧
    ∀ q' ∈ writes (Stmt.load a✝¹ a✝), SupportsStmt (trSupp M S) (tr enc dec M q')
case branch
Γ : Type u_1
inst✝³ : Inhabited Γ
Λ : Type u_2
inst✝² : Inhabited Λ
σ : Type u_3
inst✝¹ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
encdec : ∀ (a : Γ), dec (enc a) = a
inst✝ : Fintype Γ
S : Finset Λ
ss : Supports M S
q : Λ'
h : q ∈ trSupp M S
a✝² : Γ → σ → Bool
a✝¹ a✝ : Stmt₁
a_ih✝¹ :
  SupportsStmt S a✝¹ →
    (∀ q' ∈ writes a✝¹, q' ∈ trSupp M S) →
      SupportsStmt (trSupp M S) (trNormal dec a✝¹) ∧ ∀ q' ∈ writes a✝¹, SupportsStmt (trSupp M S) (tr enc dec M q')
a_ih✝ :
  SupportsStmt S a✝ →
    (∀ q' ∈ writes a✝, q' ∈ trSupp M S) →
      SupportsStmt (trSupp M S) (trNormal dec a✝) ∧ ∀ q' ∈ writes a✝, SupportsStmt (trSupp M S) (tr enc dec M q')
hs : SupportsStmt S (Stmt.branch a✝² a✝¹ a✝)
hw : ∀ q' ∈ writes (Stmt.branch a✝² a✝¹ a✝), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.branch a✝² a✝¹ a✝)) ∧
    ∀ q' ∈ writes (Stmt.branch a✝² a✝¹ a✝), SupportsStmt (trSupp M S) (tr enc dec M q')
case goto
Γ : Type u_1
inst✝³ : Inhabited Γ
Λ : Type u_2
inst✝² : Inhabited Λ
σ : Type u_3
inst✝¹ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
encdec : ∀ (a : Γ), dec (enc a) = a
inst✝ : Fintype Γ
S : Finset Λ
ss : Supports M S
q : Λ'
h : q ∈ trSupp M S
a✝ : Γ → σ → Λ
hs : SupportsStmt S (Stmt.goto a✝)
hw : ∀ q' ∈ writes (Stmt.goto a✝), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.goto a✝)) ∧
    ∀ q' ∈ writes (Stmt.goto a✝), SupportsStmt (trSupp M S) (tr enc dec M q')
case halt
Γ : Type u_1
inst✝³ : Inhabited Γ
Λ : Type u_2
inst✝² : Inhabited Λ
σ : Type u_3
inst✝¹ : Inhabited σ
n : ℕ
enc : Γ → Vector Bool n
dec : Vector Bool n → Γ
enc0 : enc default = Vector.replicate n false
M : Λ → Stmt₁
encdec : ∀ (a : Γ), dec (enc a) = a
inst✝ : Fintype Γ
S : Finset Λ
ss : Supports M S
q : Λ'
h : q ∈ trSupp M S
hs : SupportsStmt S Stmt.halt
hw : ∀ q' ∈ writes Stmt.halt, q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec Stmt.halt) ∧
    ∀ q' ∈ writes Stmt.halt, SupportsStmt (trSupp M S) (tr enc dec M q')

Next tactic:
case move d q IH =>
      unfold writes at hw ⊢
      replace IH := IH hs hw; refine' ⟨_, IH.2⟩
      cases d <;> simp only [trNormal, iterate, supportsStmt_move, IH]