-- File: FoML/FoML/Rademacher.lean
Theorem statement:
theorem extracted_formal_statement_333.{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 : ι)
  (h_original_goal :
    (∫ (ω' : Fin n → Ω), ∑ k, f i (X (ω k)) - ∑ k, f i (X (ω' k)) ∂Measure.pi fun x => μ) =
      (∫ (ω' : Fin n → Ω), ∑ k, f i (X (ω k)) ∂Measure.pi fun x => μ) -
        ∫ (ω' : Fin n → Ω), ∑ k, f i (X (ω' k)) ∂Measure.pi fun x => μ) :
  Integrable (fun a => ∑ k, f i (X (a k))) (Measure.pi fun x => μ) := sorry

Tactic 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 : ι
⊢ (∫ (ω' : Fin n → Ω), ∑ k, f i (X (ω k)) - ∑ k, f i (X (ω' k)) ∂Measure.pi fun x => μ) =
    (∫ (ω' : Fin n → Ω), ∑ k, f i (X (ω k)) ∂Measure.pi fun x => μ) -
      ∫ (ω' : Fin n → Ω), ∑ k, f i (X (ω' k)) ∂Measure.pi fun x => μ

Tactic: apply integral_sub

Tactic state after:
[case hf
 Ω : 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 : ι
 ⊢ Integrable (fun a => ∑ k, f i (X (ω k))) (Measure.pi fun x => μ),
 case hg
 Ω : 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 : ι
 ⊢ Integrable (fun a => ∑ k, f i (X (a k))) (Measure.pi fun x => μ)]

Premises used:
MeasureTheory.integral_sub : ∀ {α : Type u_1} {G : Type u_5} [inst : NormedAddCommGroup G] [inst_2 : NormedSpace ℝ G]
  {m : MeasurableSpace α} {μ : Measure α} {f g : α → G},
  Integrable f μ → Integrable g μ → ∫ (a : α), f a - g a ∂μ = ∫ (a : α), f a ∂μ - ∫ (a : α), g a ∂μ