theorem extracted_formal_statement_2.{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) (σ : Fin n → { x // x ∈ {-1, 1} }) (a : σ ∈ Finset.univ) :
  Measurable fun a =>
    ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (a.2 i).1) - f I (X (a.2 i).2)) + (f I (X a.1.1) - f I (X a.1.2) + c I) := sorry

State before:
case left.hf.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
σ : Fin n → { x // x ∈ {-1, 1} }
a✝ : σ ∈ Finset.univ
⊢ Measurable fun a =>
    ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (a.2 i).1) - f I (X (a.2 i).2)) + (f I (X a.1.1) - f I (X a.1.2) + c I)

Tactic: apply Measurable.iSup
    intro I
    apply Measurable.add
    ·
  apply Finset.measurable_sum Finset.univ
  intro i _
  apply Measurable.const_mul
  exact (measurable_sub_part h𝓕).comp measurable_snd
    ·
  apply Measurable.add_const
  apply Measurable.sub
  · exact (h𝓕 I).comp <| measurable_fst.comp measurable_fst
  · exact (h𝓕 I).comp <| measurable_snd.comp measurable_fst

State after:

Relevant lemmas:
measurable_fst : ∀ {α : Type u_1} {β : Type u_2} {x : MeasurableSpace α} {x_1 : MeasurableSpace β}, Measurable Prod.fst
Measurable.iSup : ∀ {α : Type u_1} {δ : Type u_4} [inst : TopologicalSpace α] {mα : MeasurableSpace α}
  [inst_4 : BorelSpace α] {mδ : MeasurableSpace δ} [inst_5 : ConditionallyCompleteLinearOrder α]
  [inst_6 : OrderTopology α] [inst : SecondCountableTopology α] {ι : Sort u_5} [inst : Countable ι] {f : ι → δ → α},
  (∀ (i : ι), Measurable (f i)) → Measurable fun b => ⨆ i, f i b
Measurable.add : ∀ {M : Type u_2} {α : Type u_3} [inst : MeasurableSpace M] [inst_4 : Add M] {m : MeasurableSpace α}
  {f g : α → M} [inst_5 : MeasurableAdd₂ M], Measurable f → Measurable g → Measurable fun a => f a + g a
measurable_snd : ∀ {α : Type u_1} {β : Type u_2} {x : MeasurableSpace α} {x_1 : MeasurableSpace β}, Measurable Prod.snd
Measurable.add_const : ∀ {M : Type u_2} {α : Type u_3} [inst : MeasurableSpace M] [inst_4 : Add M]
  {m : MeasurableSpace α} {f : α → M} [inst_5 : MeasurableAdd M], Measurable f → ∀ (c : M), Measurable fun x => f x + c
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
Measurable.sub : ∀ {G : Type u_2} {α : Type u_3} [inst : MeasurableSpace G] [inst_4 : Sub G] {m : MeasurableSpace α}
  {f g : α → G} [inst_5 : MeasurableSub₂ G], Measurable f → Measurable g → Measurable fun a => f a - g a
Measurable.const_mul : ∀ {M : Type u_2} {α : Type u_3} [inst : MeasurableSpace M] [inst_4 : Mul M]
  {m : MeasurableSpace α} {f : α → M} [inst_5 : MeasurableMul M], Measurable f → ∀ (c : M), Measurable fun x => c * f x
measurable_sub_part : ∀ {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} [inst : MeasurableSpace Ω] {X : Ω → Z}
  [inst_4 : Countable ι],
  (∀ (I : ι), Measurable (f I ∘ X)) →
    ∀ {n : ℕ} {I : ι} {i : Fin n}, Measurable fun ω => f I (X (ω i).1) - f I (X (ω i).2)