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

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

Tactic: apply Measurable.sub
    apply (hf i).comp measurable_const
    exact measurable_aux0 hf i k

State after:

Relevant lemmas:
measurable_const : ∀ {α : Type u_1} {β : Type u_2} {x : MeasurableSpace α} {x_1 : MeasurableSpace β} {a : α},
  Measurable fun x => a
measurable_aux0 : ∀ {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ} {ι : Type u_1} {f : ι → Z → ℝ}
  {X : Ω → Z}, (∀ (i : ι), Measurable (f i ∘ X)) → ∀ (i : ι) (k : Fin n), Measurable fun ω => f i (X (ω k))
Measurable.sub : ∀ {G : Type u_2} {α : Type u_3} [inst : MeasurableSpace G] [inst_2 : Sub G] {m : MeasurableSpace α}
  {f g : α → G} [inst_3 : MeasurableSub₂ G], Measurable f → Measurable g → Measurable fun a => f a - g a