theorem extracted_formal_statement_129.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] [inst_2 : Countable ι]
  [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ} (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {n : ℕ}
  {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C)
  (h_original_goal :
    Measurable fun x =>
      ∑ σ,
        ⨆ I,
          ∑ i, ↑↑(σ ↑↑i) * (f I (X (x.2 i).1) - f I (X (x.2 i).2)) + (↑↑(σ ↑n) * (f I (X x.1.1) - f I (X x.1.2)) + c I))
  (i : Fin (n + 1) → { x // x ∈ {-1, 1} }) :
  i ∈ Finset.univ →
    Measurable fun a =>
      ⨆ I,
        ∑ i_1, ↑↑(i ↑↑i_1) * (f I (X (a.2 i_1).1) - f I (X (a.2 i_1).2)) +
          (↑↑(i ↑n) * (f I (X a.1.1) - f I (X a.1.2)) + c I) := sorry

State before:
case left.hf.hf
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
n : ℕ
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
⊢ Measurable fun x =>
    ∑ σ,
      ⨆ I, ∑ i, ↑↑(σ ↑↑i) * (f I (X (x.2 i).1) - f I (X (x.2 i).2)) + (↑↑(σ ↑n) * (f I (X x.1.1) - f I (X x.1.2)) + c I)

Tactic: apply Finset.measurable_sum Finset.univ

State after:
[case left.hf.hf
 Z : Type w
 ι : Type v
 f : ι → Z → ℝ
 Ω : Type u
 inst✝³ : MeasurableSpace Ω
 X : Ω → Z
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Countable ι
 inst✝ : Nonempty ι
 h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
 b : ℝ
 h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
 n : ℕ
 c : ι → ℝ
 C : ℝ
 hC : ∀ (I : ι), |c I| ≤ C
 ⊢ ∀ i ∈ Finset.univ,
     Measurable fun a =>
       ⨆ I,
         ∑ i_1, ↑↑(i ↑↑i_1) * (f I (X (a.2 i_1).1) - f I (X (a.2 i_1).2)) +
           (↑↑(i ↑n) * (f I (X a.1.1) - f I (X a.1.2)) + c I)]

Relevant lemmas:
Finset.measurable_sum : ∀ {M : Type u_2} {ι : Type u_3} {α : Type u_4} [inst : AddCommMonoid M]
  [inst_4 : MeasurableSpace M] [inst_5 : MeasurableAdd₂ M] {m : MeasurableSpace α} {f : ι → α → M} (s : Finset ι),
  (∀ i ∈ s, Measurable (f i)) → Measurable fun a => ∑ i ∈ s, f i a