theorem extracted_formal_statement_322.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {X : Ω → Z} [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) (i : ι)
  (k : Fin n) (a : k ∈ Finset.univ) (h_original_goal : Measurable fun a => f i (X (a.1 k)) - f i (X (a.2 k))) :
  Measurable fun a => f i (X (a.1 k)) := sorry

State before:
case hf.hf
Ω : Type u
inst✝ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
X : Ω → Z
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
i : ι
k : Fin n
a✝ : k ∈ Finset.univ
⊢ Measurable fun a => f i (X (a.1 k)) - f i (X (a.2 k))

Tactic: apply Measurable.sub

State after:
[case hf.hf.hf
 Ω : Type u
 inst✝ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 X : Ω → Z
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 i : ι
 k : Fin n
 a✝ : k ∈ Finset.univ
 ⊢ Measurable fun a => f i (X (a.1 k)),
 case hf.hf.hg
 Ω : Type u
 inst✝ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 X : Ω → Z
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 i : ι
 k : Fin n
 a✝ : k ∈ Finset.univ
 ⊢ Measurable fun a => f i (X (a.2 k))]

Relevant lemmas:
Measurable.sub : ∀ {G : Type u_2} {α : Type u_3} [inst : MeasurableSpace G] [inst_1 : Sub G] {m : MeasurableSpace α}
  {f g : α → G} [inst_2 : MeasurableSub₂ G], Measurable f → Measurable g → Measurable fun a => f a - g a