zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_75.{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 ω => ⨆ I, ∑ i, (f I (X (ω.2 i).1) - f I (X (ω.2 i).2)) + (f I (X ω.1.1) - f I (X ω.1.2) + c I))
  (i : ι) :
  Measurable fun b =>
    ∑ i_1, (f i (X (b.2 i_1).1) - f i (X (b.2 i_1).2)) + (f i (X b.1.1) - f i (X b.1.2) + c i) := sorry

Tactic state before:
case left.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 ω => ⨆ I, ∑ i, (f I (X (ω.2 i).1) - f I (X (ω.2 i).2)) + (f I (X ω.1.1) - f I (X ω.1.2) + c I)

Tactic:
apply Measurable.iSup

Tactic 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 : ι),
     Measurable fun b => ∑ i_1, (f i (X (b.2 i_1).1) - f i (X (b.2 i_1).2)) + (f i (X b.1.1) - f i (X b.1.2) + c i)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_76.{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) (I : ι)
  (h_original_goal :
    Measurable fun b => ∑ i, (f I (X (b.2 i).1) - f I (X (b.2 i).2)) + (f I (X b.1.1) - f I (X b.1.2) + c I)) :
  Measurable fun a => ∑ i, (f I (X (a.2 i).1) - f I (X (a.2 i).2)) := sorry

Tactic 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
I : ι
⊢ Measurable fun b => ∑ i, (f I (X (b.2 i).1) - f I (X (b.2 i).2)) + (f I (X b.1.1) - f I (X b.1.2) + c I)

Tactic:
apply Measurable.add

Tactic state after:
[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
 I : ι
 ⊢ Measurable fun a => ∑ i, (f I (X (a.2 i).1) - f I (X (a.2 i).2)),
 case left.hf.hf.hg
 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 : ι
 ⊢ Measurable fun a => f I (X a.1.1) - f I (X a.1.2) + c I]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_77.{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) (I : ι)
  (h_original_goal :
    Measurable fun b => ∑ i, (f I (X (b.2 i).1) - f I (X (b.2 i).2)) + (f I (X b.1.1) - f I (X b.1.2) + c I)) :
  Measurable fun a => f I (X a.1.1) - f I (X a.1.2) + c I := sorry

Tactic 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
I : ι
⊢ Measurable fun b => ∑ i, (f I (X (b.2 i).1) - f I (X (b.2 i).2)) + (f I (X b.1.1) - f I (X b.1.2) + c I)

Tactic:
apply Measurable.add

Tactic state after:
[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
 I : ι
 ⊢ Measurable fun a => ∑ i, (f I (X (a.2 i).1) - f I (X (a.2 i).2)),
 case left.hf.hf.hg
 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 : ι
 ⊢ Measurable fun a => f I (X a.1.1) - f I (X a.1.2) + c I]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_78.{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) (I : ι)
  (h_original_goal : Measurable fun a => ∑ i, (f I (X (a.2 i).1) - f I (X (a.2 i).2))) : Measurable Prod.snd := sorry

Tactic 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
I : ι
⊢ Measurable fun a => ∑ i, (f I (X (a.2 i).1) - f I (X (a.2 i).2))

Tactic:
apply (measurable_sum_part h𝓕).comp

Tactic state after:
[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
 I : ι
 ⊢ Measurable Prod.snd]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_79.{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) : Measurable Prod.snd := sorry

Tactic 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
I : ι
⊢ Measurable Prod.snd

Tactic:
exact measurable_snd

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_80.{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) (I : ι)
  (h_original_goal : Measurable fun a => f I (X a.1.1) - f I (X a.1.2) + c I) :
  Measurable fun x => f I (X x.1.1) - f I (X x.1.2) := sorry

Tactic state before:
case left.hf.hf.hg
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 : ι
⊢ Measurable fun a => f I (X a.1.1) - f I (X a.1.2) + c I

Tactic:
apply Measurable.add_const

Tactic state after:
[case left.hf.hf.hg.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 : ι
 ⊢ Measurable fun x => f I (X x.1.1) - f I (X x.1.2)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_81.{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) (I : ι)
  (h_original_goal : Measurable fun x => f I (X x.1.1) - f I (X x.1.2)) : Measurable fun a => f I (X a.1.1) := sorry

Tactic state before:
case left.hf.hf.hg.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 : ι
⊢ Measurable fun x => f I (X x.1.1) - f I (X x.1.2)

Tactic:
apply Measurable.sub

Tactic state after:
[case left.hf.hf.hg.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 : ι
 ⊢ Measurable fun a => f I (X a.1.1),
 case left.hf.hf.hg.hf.hg
 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 : ι
 ⊢ Measurable fun a => f I (X a.1.2)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_82.{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) (I : ι)
  (h_original_goal : Measurable fun x => f I (X x.1.1) - f I (X x.1.2)) : Measurable fun a => f I (X a.1.2) := sorry

Tactic state before:
case left.hf.hf.hg.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 : ι
⊢ Measurable fun x => f I (X x.1.1) - f I (X x.1.2)

Tactic:
apply Measurable.sub

Tactic state after:
[case left.hf.hf.hg.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 : ι
 ⊢ Measurable fun a => f I (X a.1.1),
 case left.hf.hf.hg.hf.hg
 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 : ι
 ⊢ Measurable fun a => f I (X a.1.2)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_83.{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) (I : ι) : Measurable fun a => f I (X a.1.1) := sorry

Tactic state before:
case left.hf.hf.hg.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 : ι
⊢ Measurable fun a => f I (X a.1.1)

Tactic:
exact (h𝓕 I).comp <| measurable_fst.comp measurable_fst

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_84.{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) (I : ι) : Measurable fun a => f I (X a.1.2) := sorry

Tactic state before:
case left.hf.hf.hg.hf.hg
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 : ι
⊢ Measurable fun a => f I (X a.1.2)

Tactic:
exact (h𝓕 I).comp <| measurable_snd.comp measurable_fst

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_85.{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 :
    HasFiniteIntegral
      (fun ω => ⨆ I, ∑ i, (f I (X (ω.2 i).1) - f I (X (ω.2 i).2)) + (f I (X ω.1.1) - f I (X ω.1.2) + c I))
      ((μ.prod μ).prod (Measure.pi fun x => μ.prod μ))) :
  ∀ᵐ (a : (Ω × Ω) × (Fin n → Ω × Ω)) ∂(μ.prod μ).prod (Measure.pi fun x => μ.prod μ),
    ‖⨆ 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)‖ ≤
      ↑n * (b + b) + (b + b + C) := sorry

Tactic state before:
case right
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
⊢ HasFiniteIntegral (fun ω => ⨆ I, ∑ i, (f I (X (ω.2 i).1) - f I (X (ω.2 i).2)) + (f I (X ω.1.1) - f I (X ω.1.2) + c I))
    ((μ.prod μ).prod (Measure.pi fun x => μ.prod μ))

Tactic:
apply @MeasureTheory.hasFiniteIntegral_of_bounded _ _ _ _ _ _ _ (n * (b + b) + (b + b + C))

Tactic state after:
[case right
 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
 ⊢ ∀ᵐ (a : (Ω × Ω) × (Fin n → Ω × Ω)) ∂(μ.prod μ).prod (Measure.pi fun x => μ.prod μ),
     ‖⨆ 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)‖ ≤
       ↑n * (b + b) + (b + b + C)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_86.{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 → Ω × Ω)) :
  |⨆ I, ∑ i, (f I (X (ω.2 i).1) - f I (X (ω.2 i).2)) + (f I (X ω.1.1) - f I (X ω.1.2) + c I)| ≤
    ↑n * (b + b) + (b + b + C) := sorry

Tactic state before:
case right.h
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 → Ω × Ω)
⊢ |⨆ I, ∑ i, (f I (X (ω.2 i).1) - f I (X (ω.2 i).2)) + (f I (X ω.1.1) - f I (X ω.1.2) + c I)| ≤
    ↑n * (b + b) + (b + b + C)

Tactic:
exact bound_isum' h𝓕' (boundedness₀ h𝓕' hC ω.1) ω.2

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_87.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} {X : Ω → Z} {n : ℕ}
  [inst : Nonempty ι] {b : ℝ} (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C)
  (ω' : Fin n → Ω × Ω)
  (h_original_goal :
    |2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| ≤ ↑n * (b + b) + C) :
  2⁻¹ ^ n * |∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| ≤ ↑n * (b + b) + C := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
X : Ω → Z
n : ℕ
inst✝ : Nonempty ι
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
ω' : Fin n → Ω × Ω
⊢ |2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| ≤ ↑n * (b + b) + C

Tactic:
rw [abs_mul, abs_of_pos (by simp)]

Tactic state after:
[Z : Type w
 ι : Type v
 f : ι → Z → ℝ
 Ω : Type u
 X : Ω → Z
 n : ℕ
 inst✝ : Nonempty ι
 b : ℝ
 h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
 c : ι → ℝ
 C : ℝ
 hC : ∀ (I : ι), |c I| ≤ C
 ω' : Fin n → Ω × Ω
 ⊢ 2⁻¹ ^ n * |∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| ≤ ↑n * (b + b) + C]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_88.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} {X : Ω → Z} {n : ℕ}
  [inst : Nonempty ι] {b : ℝ} (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C)
  (ω' : Fin n → Ω × Ω) :
  |∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| ≤
    ∑ σ, |⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
X : Ω → Z
n : ℕ
inst✝ : Nonempty ι
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
ω' : Fin n → Ω × Ω
⊢ |∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| ≤
    ∑ σ, |⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I|

Tactic:
apply Finset.abs_sum_le_sum_abs

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_89.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} {X : Ω → Z} {n : ℕ}
  [inst : Nonempty ι] {b : ℝ} (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C)
  (ω' : Fin n → Ω × Ω)
  (h_original_goal : ∑ σ, |⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| ≤ ∑ σ, (↑n * (b + b) + C))
  (i : Fin n → { x // x ∈ {-1, 1} }) :
  i ∈ Finset.univ →
    |⨆ I, ∑ i_1, ↑↑(i i_1) * (f I (X (ω' i_1).1) - f I (X (ω' i_1).2)) + c I| ≤ ↑n * (b + b) + C := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
X : Ω → Z
n : ℕ
inst✝ : Nonempty ι
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
ω' : Fin n → Ω × Ω
⊢ ∑ σ, |⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| ≤ ∑ σ, (↑n * (b + b) + C)

Tactic:
apply Finset.sum_le_sum

Tactic state after:
[case h
 Z : Type w
 ι : Type v
 f : ι → Z → ℝ
 Ω : Type u
 X : Ω → Z
 n : ℕ
 inst✝ : Nonempty ι
 b : ℝ
 h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
 c : ι → ℝ
 C : ℝ
 hC : ∀ (I : ι), |c I| ≤ C
 ω' : Fin n → Ω × Ω
 ⊢ ∀ i ∈ Finset.univ, |⨆ I, ∑ i_1, ↑↑(i i_1) * (f I (X (ω' i_1).1) - f I (X (ω' i_1).2)) + c I| ≤ ↑n * (b + b) + C]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_90.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} {X : Ω → Z} {n : ℕ}
  [inst : Nonempty ι] {b : ℝ} (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C)
  (ω' : Fin n → Ω × Ω) (σ : Fin n → { x // x ∈ {-1, 1} }) (a : σ ∈ Finset.univ) :
  |⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| ≤ ↑n * (b + b) + C := sorry

Tactic state before:
case h
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
X : Ω → Z
n : ℕ
inst✝ : Nonempty ι
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
ω' : Fin n → Ω × Ω
σ : Fin n → { x // x ∈ {-1, 1} }
a✝ : σ ∈ Finset.univ
⊢ |⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I| ≤ ↑n * (b + b) + C

Tactic:
apply bound_isum h𝓕' hC

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_91.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} {X : Ω → Z} {n : ℕ}
  [inst : Nonempty ι] {b : ℝ} (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C) :
  ∑ σ, (↑n * (b + b) + C) = Finset.univ.card • (↑n * (b + b) + C) := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
X : Ω → Z
n : ℕ
inst✝ : Nonempty ι
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
ω' : Fin n → Ω × Ω
⊢ ∑ σ, (↑n * (b + b) + C) = Finset.univ.card • (↑n * (b + b) + C)

Tactic:
exact Finset.sum_const (n * (b + b) + C)

Tactic state after: