zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_320.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {X : Ω → Z} [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X))
  (h_original_goal : Measurable fun ω => ⨆ i, |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|) (i : ι) :
  Measurable fun b => |∑ k, (f i (X (b.1 k)) - f i (X (b.2 k)))| := sorry

Tactic state before:
Ω : Type u
inst✝ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
X : Ω → Z
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
⊢ Measurable fun ω => ⨆ i, |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|

Tactic:
apply Measurable.iSup

Tactic state after:
[case hf
 Ω : Type u
 inst✝ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 X : Ω → Z
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 ⊢ ∀ (i : ι), Measurable fun b => |∑ k, (f i (X (b.1 k)) - f i (X (b.2 k)))|]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_321.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {X : Ω → Z} [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) (i : ι)
  (h_original_goal : Measurable fun b => |∑ k, (f i (X (b.1 k)) - f i (X (b.2 k)))|) :
  Measurable fun x => ∑ k, (f i (X (x.1 k)) - f i (X (x.2 k))) := sorry

Tactic state before:
case hf
Ω : Type u
inst✝ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
X : Ω → Z
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
i : ι
⊢ Measurable fun b => |∑ k, (f i (X (b.1 k)) - f i (X (b.2 k)))|

Tactic:
apply Measurable.abs

Tactic state after:
[case hf.hf
 Ω : Type u
 inst✝ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 X : Ω → Z
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 i : ι
 ⊢ Measurable fun x => ∑ k, (f i (X (x.1 k)) - f i (X (x.2 k)))]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_322.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {X : Ω → Z} [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) (i : ι)
  (k : Fin n) (a : k ∈ Finset.univ) (h_original_goal : Measurable fun a => f i (X (a.1 k)) - f i (X (a.2 k))) :
  Measurable fun a => f i (X (a.1 k)) := sorry

Tactic state before:
case hf.hf
Ω : Type u
inst✝ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
X : Ω → Z
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
i : ι
k : Fin n
a✝ : k ∈ Finset.univ
⊢ Measurable fun a => f i (X (a.1 k)) - f i (X (a.2 k))

Tactic:
apply Measurable.sub

Tactic state after:
[case hf.hf.hf
 Ω : Type u
 inst✝ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 X : Ω → Z
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 i : ι
 k : Fin n
 a✝ : k ∈ Finset.univ
 ⊢ Measurable fun a => f i (X (a.1 k)),
 case hf.hf.hg
 Ω : Type u
 inst✝ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 X : Ω → Z
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 i : ι
 k : Fin n
 a✝ : k ∈ Finset.univ
 ⊢ Measurable fun a => f i (X (a.2 k))]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_323.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {X : Ω → Z} [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) (i : ι)
  (k : Fin n) (a : k ∈ Finset.univ) (h_original_goal : Measurable fun a => f i (X (a.1 k)) - f i (X (a.2 k))) :
  Measurable fun a => f i (X (a.2 k)) := sorry

Tactic state before:
case hf.hf
Ω : Type u
inst✝ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
X : Ω → Z
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
i : ι
k : Fin n
a✝ : k ∈ Finset.univ
⊢ Measurable fun a => f i (X (a.1 k)) - f i (X (a.2 k))

Tactic:
apply Measurable.sub

Tactic state after:
[case hf.hf.hf
 Ω : Type u
 inst✝ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 X : Ω → Z
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 i : ι
 k : Fin n
 a✝ : k ∈ Finset.univ
 ⊢ Measurable fun a => f i (X (a.1 k)),
 case hf.hf.hg
 Ω : Type u
 inst✝ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 X : Ω → Z
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 i : ι
 k : Fin n
 a✝ : k ∈ Finset.univ
 ⊢ Measurable fun a => f i (X (a.2 k))]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_324.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {X : Ω → Z} [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) (i : ι)
  (k : Fin n) (a : k ∈ Finset.univ) : Measurable fun a => f i (X (a.2 k)) := sorry

Tactic state before:
case hf.hf.hg
Ω : Type u
inst✝ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
X : Ω → Z
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
i : ι
k : Fin n
a✝ : k ∈ Finset.univ
⊢ Measurable fun a => f i (X (a.2 k))

Tactic:
apply (hf i).comp measurable_snd.eval

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_325.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z} [inst_2 : Nonempty ι]
  [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b)
  (h_original_goal :
    Integrable (fun ω => ⨆ i, |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|)
      ((Measure.pi fun x => μ).prod (Measure.pi fun x => μ))) :
  MemLp (fun ω => ⨆ i, |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|) 1
    ((Measure.pi fun x => μ).prod (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
inst_2 : Nonempty ι
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
⊢ Integrable (fun ω => ⨆ i, |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|)
    ((Measure.pi fun x => μ).prod (Measure.pi fun x => μ))

Tactic:
rw [← memLp_one_iff_integrable]

Tactic state after:
[Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ⊢ MemLp (fun ω => ⨆ i, |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|) 1
     ((Measure.pi fun x => μ).prod (Measure.pi fun x => μ))]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_326.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z} [inst_2 : Nonempty ι]
  [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b)
  (h_original_goal :
    MemLp (fun ω => ⨆ i, |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|) 1
      ((Measure.pi fun x => μ).prod (Measure.pi fun x => μ))) :
  ∀ᵐ (x : (Fin n → Ω) × (Fin n → Ω)) ∂(Measure.pi fun x => μ).prod (Measure.pi fun x => μ),
    ‖⨆ i, |∑ k, (f i (X (x.1 k)) - f i (X (x.2 k)))|‖ ≤ ↑n * (b + b) := sorry

Tactic state before:
Ω : Type u
inst✝¹ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
X : Ω → Z
inst_2 : Nonempty ι
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
⊢ MemLp (fun ω => ⨆ i, |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|) 1
    ((Measure.pi fun x => μ).prod (Measure.pi fun x => μ))

Tactic:
apply MemLp.of_bound (extracted_5_aux hf).aestronglyMeasurable (n * (b + b))

Tactic state after:
[Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ⊢ ∀ᵐ (x : (Fin n → Ω) × (Fin n → Ω)) ∂(Measure.pi fun x => μ).prod (Measure.pi fun x => μ),
     ‖⨆ i, |∑ k, (f i (X (x.1 k)) - f i (X (x.2 k)))|‖ ≤ ↑n * (b + b)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_327.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z} [inst_2 : Nonempty ι]
  [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b)
  (ω : (Fin n → Ω) × (Fin n → Ω)) (h_original_goal : ‖⨆ i, |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|‖ ≤ ↑n * (b + b))
  (i : ι) : |(|∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|)| ≤ ↑n * (b + b) := sorry

Tactic state before:
case h
Ω : Type u
inst✝¹ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
X : Ω → Z
inst_2 : Nonempty ι
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : (Fin n → Ω) × (Fin n → Ω)
⊢ ‖⨆ i, |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|‖ ≤ ↑n * (b + b)

Tactic:
apply abs_iSup_le

Tactic state after:
[case h.hf
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : (Fin n → Ω) × (Fin n → Ω)
 ⊢ ∀ (i : ι), |(|∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|)| ≤ ↑n * (b + b)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_328.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z} [inst_2 : Nonempty ι]
  [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b)
  (ω : (Fin n → Ω) × (Fin n → Ω)) (i : ι)
  (h_original_goal : |(|∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|)| ≤ ↑n * (b + b)) :
  |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))| ≤ ↑n * (b + b) := sorry

Tactic state before:
case h.hf
Ω : Type u
inst✝¹ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
X : Ω → Z
inst_2 : Nonempty ι
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : (Fin n → Ω) × (Fin n → Ω)
i : ι
⊢ |(|∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))|)| ≤ ↑n * (b + b)

Tactic:
simp only [abs_abs]

Tactic state after:
[case h.hf
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : (Fin n → Ω) × (Fin n → Ω)
 i : ι
 ⊢ |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))| ≤ ↑n * (b + b)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_329.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z} [inst_2 : Nonempty ι]
  [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b)
  (ω : (Fin n → Ω) × (Fin n → Ω)) (i : ι) : |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))| ≤ ↑n * (b + b) := sorry

Tactic state before:
case h.hf
Ω : Type u
inst✝¹ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
X : Ω → Z
inst_2 : Nonempty ι
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : (Fin n → Ω) × (Fin n → Ω)
i : ι
⊢ |∑ k, (f i (X (ω.1 k)) - f i (X (ω.2 k)))| ≤ ↑n * (b + b)

Tactic:
exact bounded_difference_of_bounded hf' ω.1 i ω.2

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

Tactic:
apply congrArg

Tactic state after:
[case h
 Ω : 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 : ι
 ⊢ (fun ω' => ∑ k, (f i (X (ω k)) - f i (X (ω' k)))) = fun ω' => ∑ k, f i (X (ω k)) - ∑ k, f i (X (ω' k))]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_331.{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 : ι)
  (ω' : Fin n → Ω) : ∑ k, (f i (X (ω k)) - f i (X (ω' k))) = ∑ k, f i (X (ω k)) - ∑ k, f i (X (ω' k)) := sorry

Tactic state before:
case h.h
Ω : 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)) - f i (X (ω' k))) = ∑ k, f i (X (ω k)) - ∑ k, f i (X (ω' k))

Tactic:
exact Finset.sum_sub_distrib

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_332.{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 (ω 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 => μ)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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 => μ)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_334.{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 : ι) :
  Integrable (fun a => ∑ k, f i (X (ω k))) (Measure.pi fun x => μ) := sorry

Tactic state before:
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 => μ)

Tactic:
simp

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

Tactic:
simp

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

Tactic:
simp only [sub_right_inj]

Tactic state after:
[Ω : 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)) ∂Measure.pi fun x => μ) =
     ∑ k, ∫ (ω' : Fin n → Ω), f i (X (ω' k)) ∂Measure.pi fun x => μ]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

Tactic:
exact integral_finset_sum Finset.univ (fun i_1 a ↦ integrable_aux0 hf hf' i i_1)

Tactic state after: