theorem extracted_formal_statement_17.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {ι : Type u_1}
  [inst_1 : AddCommMonoid Z] [inst_2 : MeasurableSpace Z] [inst_3 : MeasurableAdd₂ Z] {X : Ω → Z} (hX : Measurable X)
  (s : Finset ι) : Measurable fun ω => ∑ k ∈ s, X (ω k) := sorry

State before:
Ω : Type u
inst✝³ : MeasurableSpace Ω
Z : Type w
ι : Type u_1
inst✝² : AddCommMonoid Z
inst✝¹ : MeasurableSpace Z
inst✝ : MeasurableAdd₂ Z
X : Ω → Z
hX : Measurable X
s : Finset ι
⊢ Measurable fun ω => ∑ k ∈ s, X (ω k)

Tactic: apply s.measurable_sum
    intro k _
    apply hX.comp (measurable_pi_apply k)

State after:

Relevant lemmas:
measurable_pi_apply : ∀ {δ : Type u_4} {X : δ → Type u_6} [inst : (a : δ) → MeasurableSpace (X a)] (a : δ),
  Measurable fun f => f a