theorem extracted_formal_statement_338.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z}
  (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (ω : Fin n → Ω) (i : ι) :
  (∑ k, f i (X (ω k)) - ∑ k, ∫ (ω' : Fin n → Ω), f i (X (ω' k)) ∂Measure.pi fun x => μ) =
    ∑ k, (f i (X (ω k)) - ∫ (ω' : Fin n → Ω), f i (X (ω' k)) ∂Measure.pi fun x => μ) := sorry

State before:
Ω : Type u
inst✝¹ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω
i : ι
⊢ (∑ k, f i (X (ω k)) - ∑ k, ∫ (ω' : Fin n → Ω), f i (X (ω' k)) ∂Measure.pi fun x => μ) =
    ∑ k, (f i (X (ω k)) - ∫ (ω' : Fin n → Ω), f i (X (ω' k)) ∂Measure.pi fun x => μ)

Tactic: exact Eq.symm Finset.sum_sub_distrib

State after:

Relevant lemmas:
Eq.symm : ∀ {α : Sort u} {a b : α}, a = b → b = a
Finset.sum_sub_distrib : ∀ {α : Type u_3} {β : Type u_4} {s : Finset α} {f g : α → β} [inst : SubtractionCommMonoid β],
  ∑ x ∈ s, (f x - g x) = ∑ x ∈ s, f x - ∑ x ∈ s, g x