Theorem: Turing.TM1to1.tr_supports
File: Mathlib/Computability/TuringMachine.lean

tactic: 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]
state_before: Γ : 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
⊢ SupportsStmt (trSupp M S) (tr enc dec M q)
state_after: Γ : 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
⊢ ∀ (q : Stmt₁),
    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')

tactic: intro q hs hw
state_before: Γ : 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
⊢ ∀ (q : Stmt₁),
    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')
state_after: Γ : 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
q : Stmt₁
hs : SupportsStmt S q
hw : ∀ 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')

tactic: rcases Finset.mem_biUnion.1 h with ⟨l, hl, h⟩
state_before: Γ : 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
this :
  ∀ (q : Stmt₁),
    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')
⊢ SupportsStmt (trSupp M S) (tr enc dec M q)
state_after: case intro.intro
Γ : 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
this :
  ∀ (q : Stmt₁),
    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')
l : Λ
hl : l ∈ S
h : q ∈ insert (Λ'.normal l) (writes (M l))
⊢ SupportsStmt (trSupp M S) (tr enc dec M q)

tactic: have :=
  this _ (ss.2 _ hl) fun q' hq ↦ Finset.mem_biUnion.2 ⟨_, hl, Finset.mem_insert_of_mem hq⟩
state_before: case intro.intro
Γ : 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
this :
  ∀ (q : Stmt₁),
    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')
l : Λ
hl : l ∈ S
h : q ∈ insert (Λ'.normal l) (writes (M l))
⊢ SupportsStmt (trSupp M S) (tr enc dec M q)
state_after: case intro.intro
Γ : 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
this✝ :
  ∀ (q : Stmt₁),
    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')
l : Λ
hl : l ∈ S
h : q ∈ insert (Λ'.normal l) (writes (M l))
this : SupportsStmt (trSupp M S) (trNormal dec (M l)) ∧ ∀ q' ∈ writes (M l), SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (tr enc dec M q)

tactic: rcases Finset.mem_insert.1 h with (rfl | h)
state_before: case intro.intro
Γ : 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
this✝ :
  ∀ (q : Stmt₁),
    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')
l : Λ
hl : l ∈ S
h : q ∈ insert (Λ'.normal l) (writes (M l))
this : SupportsStmt (trSupp M S) (trNormal dec (M l)) ∧ ∀ q' ∈ writes (M l), SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (tr enc dec M q)
state_after: case intro.intro.inl
Γ : 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
this✝ :
  ∀ (q : Stmt₁),
    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')
l : Λ
hl : l ∈ S
this : SupportsStmt (trSupp M S) (trNormal dec (M l)) ∧ ∀ q' ∈ writes (M l), SupportsStmt (trSupp M S) (tr enc dec M q')
h✝ : Λ'.normal l ∈ trSupp M S
h : Λ'.normal l ∈ insert (Λ'.normal l) (writes (M l))
⊢ SupportsStmt (trSupp M S) (tr enc dec M (Λ'.normal l))

case intro.intro.inr
Γ : 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
this✝ :
  ∀ (q : Stmt₁),
    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')
l : Λ
hl : l ∈ S
h✝ : q ∈ insert (Λ'.normal l) (writes (M l))
this : SupportsStmt (trSupp M S) (trNormal dec (M l)) ∧ ∀ q' ∈ writes (M l), SupportsStmt (trSupp M S) (tr enc dec M q')
h : q ∈ writes (M l)
⊢ SupportsStmt (trSupp M S) (tr enc dec M q)

tactic: exacts [this.1, this.2 _ h]
state_before: case intro.intro.inl
Γ : 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
this✝ :
  ∀ (q : Stmt₁),
    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')
l : Λ
hl : l ∈ S
this : SupportsStmt (trSupp M S) (trNormal dec (M l)) ∧ ∀ q' ∈ writes (M l), SupportsStmt (trSupp M S) (tr enc dec M q')
h✝ : Λ'.normal l ∈ trSupp M S
h : Λ'.normal l ∈ insert (Λ'.normal l) (writes (M l))
⊢ SupportsStmt (trSupp M S) (tr enc dec M (Λ'.normal l))

case intro.intro.inr
Γ : 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
this✝ :
  ∀ (q : Stmt₁),
    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')
l : Λ
hl : l ∈ S
h✝ : q ∈ insert (Λ'.normal l) (writes (M l))
this : SupportsStmt (trSupp M S) (trNormal dec (M l)) ∧ ∀ q' ∈ writes (M l), SupportsStmt (trSupp M S) (tr enc dec M q')
h : q ∈ writes (M l)
⊢ SupportsStmt (trSupp M S) (tr enc dec M q)
state_after: no goals

tactic: unfold writes at hw ⊢
state_before: 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
d : Dir
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.move d q)
hw : ∀ q' ∈ writes (Stmt.move d q), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.move d q)) ∧
    ∀ q' ∈ writes (Stmt.move d q), SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
d : Dir
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.move d q)
hw : ∀ q' ∈ writes q, q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.move d q)) ∧
    ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: replace IH := IH hs hw
state_before: 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
d : Dir
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.move d q)
hw : ∀ q' ∈ writes q, q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.move d q)) ∧
    ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
d : Dir
q : Stmt₁
hs : SupportsStmt S (Stmt.move d q)
hw : ∀ q' ∈ writes q, q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.move d q)) ∧
    ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: refine ⟨?_, IH.2⟩
state_before: 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
d : Dir
q : Stmt₁
hs : SupportsStmt S (Stmt.move d q)
hw : ∀ q' ∈ writes q, q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.move d q)) ∧
    ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
d : Dir
q : Stmt₁
hs : SupportsStmt S (Stmt.move d q)
hw : ∀ q' ∈ writes q, q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.move d q))

tactic: cases d <;> simp only [trNormal, iterate, supportsStmt_move, IH]
state_before: 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
d : Dir
q : Stmt₁
hs : SupportsStmt S (Stmt.move d q)
hw : ∀ q' ∈ writes q, q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.move d q))
state_after: no goals

tactic: unfold writes at hw ⊢
state_before: 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
f : Γ → σ → Γ
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ q' ∈ writes (Stmt.write f q), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.write f q)) ∧
    ∀ q' ∈ writes (Stmt.write f q), SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
f : Γ → σ → Γ
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ q' ∈ Finset.image (fun a => Λ'.write a q) Finset.univ ∪ writes q, q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.write f q)) ∧
    ∀ q' ∈ Finset.image (fun a => Λ'.write a q) Finset.univ ∪ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: simp only [Finset.mem_image, Finset.mem_union, Finset.mem_univ, exists_prop, true_and_iff]
  at hw ⊢
state_before: 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
f : Γ → σ → Γ
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ q' ∈ Finset.image (fun a => Λ'.write a q) Finset.univ ∪ writes q, q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.write f q)) ∧
    ∀ q' ∈ Finset.image (fun a => Λ'.write a q) Finset.univ ∪ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
f : Γ → σ → Γ
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.write f q)) ∧
    ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: replace IH := IH hs fun q hq ↦ hw q (Or.inr hq)
state_before: 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
f : Γ → σ → Γ
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.write f q)) ∧
    ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
f : Γ → σ → Γ
q : Stmt₁
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.write f q)) ∧
    ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: refine ⟨supportsStmt_read _ fun a _ s ↦ hw _ (Or.inl ⟨_, rfl⟩), fun q' hq ↦ ?_⟩
state_before: 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
f : Γ → σ → Γ
q : Stmt₁
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.write f q)) ∧
    ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
f : Γ → σ → Γ
q : Stmt₁
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
q' : Λ'
hq : (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q
⊢ SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: rcases hq with (⟨a, q₂, rfl⟩ | hq)
state_before: 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
f : Γ → σ → Γ
q : Stmt₁
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
q' : Λ'
hq : (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q
⊢ SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: case write.inl.intro.refl
Γ : 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
f : Γ → σ → Γ
q : Stmt₁
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
a : Γ
⊢ SupportsStmt (trSupp M S) (tr enc dec M (Λ'.write a q))

case write.inr
Γ : 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
f : Γ → σ → Γ
q : Stmt₁
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
q' : Λ'
hq : q' ∈ writes q
⊢ SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: simp only [tr, supportsStmt_write, supportsStmt_move, IH.1]
state_before: case write.inl.intro.refl
Γ : 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
f : Γ → σ → Γ
q : Stmt₁
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
a : Γ
⊢ SupportsStmt (trSupp M S) (tr enc dec M (Λ'.write a q))
state_after: no goals

tactic: exact IH.2 _ hq
state_before: case write.inr
Γ : 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
f : Γ → σ → Γ
q : Stmt₁
hs : SupportsStmt S (Stmt.write f q)
hw : ∀ (q' : Λ'), (∃ a, Λ'.write a q = q') ∨ q' ∈ writes q → q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
q' : Λ'
hq : q' ∈ writes q
⊢ SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: no goals

tactic: unfold writes at hw ⊢
state_before: 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 : Γ → σ → σ
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.load a q)
hw : ∀ q' ∈ writes (Stmt.load a q), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.load a q)) ∧
    ∀ q' ∈ writes (Stmt.load a q), SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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 : Γ → σ → σ
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.load a q)
hw : ∀ q' ∈ writes q, q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.load a q)) ∧
    ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: replace IH := IH hs hw
state_before: 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 : Γ → σ → σ
q : Stmt₁
IH :
  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')
hs : SupportsStmt S (Stmt.load a q)
hw : ∀ q' ∈ writes q, q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.load a q)) ∧
    ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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 : Γ → σ → σ
q : Stmt₁
hs : SupportsStmt S (Stmt.load a q)
hw : ∀ q' ∈ writes q, q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.load a q)) ∧
    ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: exact ⟨supportsStmt_read _ fun _ ↦ IH.1, IH.2⟩
state_before: 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 : Γ → σ → σ
q : Stmt₁
hs : SupportsStmt S (Stmt.load a q)
hw : ∀ q' ∈ writes q, q' ∈ trSupp M S
IH : SupportsStmt (trSupp M S) (trNormal dec q) ∧ ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.load a q)) ∧
    ∀ q' ∈ writes q, SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: no goals

tactic: unfold writes at hw ⊢
state_before: 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
p : Γ → σ → Bool
q₁ q₂ : Stmt₁
IH₁ :
  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')
IH₂ :
  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')
hs : SupportsStmt S (Stmt.branch p q₁ q₂)
hw : ∀ q' ∈ writes (Stmt.branch p q₁ q₂), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.branch p q₁ q₂)) ∧
    ∀ q' ∈ writes (Stmt.branch p q₁ q₂), SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
p : Γ → σ → Bool
q₁ q₂ : Stmt₁
IH₁ :
  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')
IH₂ :
  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')
hs : SupportsStmt S (Stmt.branch p q₁ q₂)
hw : ∀ q' ∈ writes q₁ ∪ writes q₂, q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.branch p q₁ q₂)) ∧
    ∀ q' ∈ writes q₁ ∪ writes q₂, SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: simp only [Finset.mem_union] at hw ⊢
state_before: 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
p : Γ → σ → Bool
q₁ q₂ : Stmt₁
IH₁ :
  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')
IH₂ :
  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')
hs : SupportsStmt S (Stmt.branch p q₁ q₂)
hw : ∀ q' ∈ writes q₁ ∪ writes q₂, q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.branch p q₁ q₂)) ∧
    ∀ q' ∈ writes q₁ ∪ writes q₂, SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
p : Γ → σ → Bool
q₁ q₂ : Stmt₁
IH₁ :
  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')
IH₂ :
  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')
hs : SupportsStmt S (Stmt.branch p q₁ q₂)
hw : ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.branch p q₁ q₂)) ∧
    ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: replace IH₁ := IH₁ hs.1 fun q hq ↦ hw q (Or.inl hq)
state_before: 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
p : Γ → σ → Bool
q₁ q₂ : Stmt₁
IH₁ :
  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')
IH₂ :
  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')
hs : SupportsStmt S (Stmt.branch p q₁ q₂)
hw : ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.branch p q₁ q₂)) ∧
    ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
p : Γ → σ → Bool
q₁ q₂ : Stmt₁
IH₂ :
  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')
hs : SupportsStmt S (Stmt.branch p q₁ q₂)
hw : ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → q' ∈ trSupp M S
IH₁ : SupportsStmt (trSupp M S) (trNormal dec q₁) ∧ ∀ q' ∈ writes q₁, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.branch p q₁ q₂)) ∧
    ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: replace IH₂ := IH₂ hs.2 fun q hq ↦ hw q (Or.inr hq)
state_before: 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
p : Γ → σ → Bool
q₁ q₂ : Stmt₁
IH₂ :
  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')
hs : SupportsStmt S (Stmt.branch p q₁ q₂)
hw : ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → q' ∈ trSupp M S
IH₁ : SupportsStmt (trSupp M S) (trNormal dec q₁) ∧ ∀ q' ∈ writes q₁, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.branch p q₁ q₂)) ∧
    ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
p : Γ → σ → Bool
q₁ q₂ : Stmt₁
hs : SupportsStmt S (Stmt.branch p q₁ q₂)
hw : ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → q' ∈ trSupp M S
IH₁ : SupportsStmt (trSupp M S) (trNormal dec q₁) ∧ ∀ q' ∈ writes q₁, SupportsStmt (trSupp M S) (tr enc dec M q')
IH₂ : SupportsStmt (trSupp M S) (trNormal dec q₂) ∧ ∀ q' ∈ writes q₂, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.branch p q₁ q₂)) ∧
    ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: exact ⟨supportsStmt_read _ fun _ ↦ ⟨IH₁.1, IH₂.1⟩, fun q ↦ Or.rec (IH₁.2 _) (IH₂.2 _)⟩
state_before: 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
p : Γ → σ → Bool
q₁ q₂ : Stmt₁
hs : SupportsStmt S (Stmt.branch p q₁ q₂)
hw : ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → q' ∈ trSupp M S
IH₁ : SupportsStmt (trSupp M S) (trNormal dec q₁) ∧ ∀ q' ∈ writes q₁, SupportsStmt (trSupp M S) (tr enc dec M q')
IH₂ : SupportsStmt (trSupp M S) (trNormal dec q₂) ∧ ∀ q' ∈ writes q₂, SupportsStmt (trSupp M S) (tr enc dec M q')
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.branch p q₁ q₂)) ∧
    ∀ (q' : Λ'), q' ∈ writes q₁ ∨ q' ∈ writes q₂ → SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: no goals

tactic: simp only [writes, Finset.not_mem_empty]
state_before: 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
l : Γ → σ → Λ
hs : SupportsStmt S (Stmt.goto l)
hw : ∀ q' ∈ writes (Stmt.goto l), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.goto l)) ∧
    ∀ q' ∈ writes (Stmt.goto l), SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
l : Γ → σ → Λ
hs : SupportsStmt S (Stmt.goto l)
hw : ∀ q' ∈ writes (Stmt.goto l), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.goto l)) ∧
    ∀ (q' : Λ'), False → SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: refine ⟨?_, fun _ ↦ False.elim⟩
state_before: 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
l : Γ → σ → Λ
hs : SupportsStmt S (Stmt.goto l)
hw : ∀ q' ∈ writes (Stmt.goto l), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.goto l)) ∧
    ∀ (q' : Λ'), False → SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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
l : Γ → σ → Λ
hs : SupportsStmt S (Stmt.goto l)
hw : ∀ q' ∈ writes (Stmt.goto l), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.goto l))

tactic: refine supportsStmt_read _ fun a _ s ↦ ?_
state_before: 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
l : Γ → σ → Λ
hs : SupportsStmt S (Stmt.goto l)
hw : ∀ q' ∈ writes (Stmt.goto l), q' ∈ trSupp M S
⊢ SupportsStmt (trSupp M S) (trNormal dec (Stmt.goto l))
state_after: 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
l : Γ → σ → Λ
hs : SupportsStmt S (Stmt.goto l)
hw : ∀ q' ∈ writes (Stmt.goto l), q' ∈ trSupp M S
a : Γ
x✝ : Bool
s : σ
⊢ (fun x s => Λ'.normal (l a s)) x✝ s ∈ trSupp M S

tactic: exact Finset.mem_biUnion.2 ⟨_, hs _ _, Finset.mem_insert_self _ _⟩
state_before: 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
l : Γ → σ → Λ
hs : SupportsStmt S (Stmt.goto l)
hw : ∀ q' ∈ writes (Stmt.goto l), q' ∈ trSupp M S
a : Γ
x✝ : Bool
s : σ
⊢ (fun x s => Λ'.normal (l a s)) x✝ s ∈ trSupp M S
state_after: no goals

tactic: simp only [writes, Finset.not_mem_empty]
state_before: 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')
state_after: 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' : Λ'), False → SupportsStmt (trSupp M S) (tr enc dec M q')

tactic: refine ⟨?_, fun _ ↦ False.elim⟩
state_before: 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' : Λ'), False → SupportsStmt (trSupp M S) (tr enc dec M q')
state_after: 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)

tactic: simp only [SupportsStmt, supportsStmt_move, trNormal]
state_before: 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)
state_after: no goals