zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_145.{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 → Ω × Ω))
  (h_original_goal :
    ∑ σ,
        |⨆ I,
            ∑ i, ↑↑(σ ↑↑i) * (f I (X (ω.2 i).1) - f I (X (ω.2 i).2)) +
              (↑↑(σ ↑n) * (f I (X ω.1.1) - f I (X ω.1.2)) + c I)| ≤
      ∑ σ, (↑n * (b + b) + (b + b + C)))
  (i : Fin (n + 1) → { x // x ∈ {-1, 1} }) :
  i ∈ Finset.univ →
    |⨆ I,
          ∑ i_1, ↑↑(i ↑↑i_1) * (f I (X (ω.2 i_1).1) - f I (X (ω.2 i_1).2)) +
            (↑↑(i ↑n) * (f I (X ω.1.1) - f I (X ω.1.2)) + c I)| ≤
      ↑n * (b + b) + (b + b + C) := sorry

Tactic state before:
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, ↑↑(σ ↑↑i) * (f I (X (ω.2 i).1) - f I (X (ω.2 i).2)) +
            (↑↑(σ ↑n) * (f I (X ω.1.1) - f I (X ω.1.2)) + c I)| ≤
    ∑ σ, (↑n * (b + b) + (b + b + C))

Tactic:
apply Finset.sum_le_sum

Tactic state after:
[case 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 ∈ Finset.univ,
     |⨆ I,
           ∑ i_1, ↑↑(i ↑↑i_1) * (f I (X (ω.2 i_1).1) - f I (X (ω.2 i_1).2)) +
             (↑↑(i ↑n) * (f I (X ω.1.1) - f I (X ω.1.2)) + c I)| ≤
       ↑n * (b + b) + (b + b + C)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_146.{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 → Ω × Ω))
  (σ : Fin (n + 1) → { x // x ∈ {-1, 1} }) (a : σ ∈ Finset.univ)
  (h_original_goal :
    |⨆ I,
          ∑ i, ↑↑(σ ↑↑i) * (f I (X (ω.2 i).1) - f I (X (ω.2 i).2)) +
            (↑↑(σ ↑n) * (f I (X ω.1.1) - f I (X ω.1.2)) + c I)| ≤
      ↑n * (b + b) + (b + b + C))
  (I : ι) : |↑↑(σ ↑n) * (f I (X ω.1.1) - f I (X ω.1.2)) + c I| ≤ b + b + C := sorry

Tactic state before:
case 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 → Ω × Ω)
σ : Fin (n + 1) → { x // x ∈ {-1, 1} }
a✝ : σ ∈ Finset.univ
⊢ |⨆ I, ∑ i, ↑↑(σ ↑↑i) * (f I (X (ω.2 i).1) - f I (X (ω.2 i).2)) + (↑↑(σ ↑n) * (f I (X ω.1.1) - f I (X ω.1.2)) + c I)| ≤
    ↑n * (b + b) + (b + b + C)

Tactic:
apply bound_isum h𝓕'

Tactic state after:
[case h.hC
 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 → Ω × Ω)
 σ : Fin (n + 1) → { x // x ∈ {-1, 1} }
 a✝ : σ ∈ Finset.univ
 ⊢ ∀ (I : ι), |↑↑(σ ↑n) * (f I (X ω.1.1) - f I (X ω.1.2)) + c I| ≤ b + b + C]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_147.{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 → Ω × Ω))
  (σ : Fin (n + 1) → { x // x ∈ {-1, 1} }) (a : σ ∈ Finset.univ) (I : ι) :
  |↑↑(σ ↑n) * (f I (X ω.1.1) - f I (X ω.1.2)) + c I| ≤ b + b + C := sorry

Tactic state before:
case h.hC
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 → Ω × Ω)
σ : Fin (n + 1) → { x // x ∈ {-1, 1} }
a✝ : σ ∈ Finset.univ
⊢ ∀ (I : ι), |↑↑(σ ↑n) * (f I (X ω.1.1) - f I (X ω.1.2)) + c I| ≤ b + b + C

Tactic:
exact boundedness₁ h𝓕' hC ω.1 (σ n)

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_148.{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 : Finset.univ.card • (↑n * (b + b) + (b + b + C)) = 2 ^ (n + 1) * (↑n * (b + b) + (b + b + C))) :
  2 ^ (n + 1) * (↑n * (b + b)) + (2 ^ (n + 1) * b + 2 ^ (n + 1) * b + 2 ^ (n + 1) * C) =
    2 ^ (n + 1) * (↑n * (b + b) + (b + b + C)) := sorry

Tactic state before:
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 → Ω × Ω)
⊢ Finset.univ.card • (↑n * (b + b) + (b + b + C)) = 2 ^ (n + 1) * (↑n * (b + b) + (b + b + C))

Tactic:
simp only [Int.reduceNeg, Finset.card_univ, Finset.mem_insert, Finset.mem_singleton, Fintype.card_pi,
  Fintype.card_coe, reduceCtorEq, not_false_eq_true, Finset.card_insert_of_not_mem, Finset.card_singleton,
  Nat.reduceAdd, Finset.prod_const, Fintype.card_fin, smul_add, nsmul_eq_mul, Nat.cast_pow, Nat.cast_ofNat]

Tactic state after:
[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 → Ω × Ω)
 ⊢ 2 ^ (n + 1) * (↑n * (b + b)) + (2 ^ (n + 1) * b + 2 ^ (n + 1) * b + 2 ^ (n + 1) * C) =
     2 ^ (n + 1) * (↑n * (b + b) + (b + b + C))]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

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

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

Tactic:
simp

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_154.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n : ℕ} (ω : Ω × Ω)
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C) :
  let μ2n := Measure.pi fun x => μ.prod μ;
  Integrable
    (fun a =>
      2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (a i).1) - f I (X (a i).2)) + (f I (X ω.2) - f I (X ω.1) + c I))
    μ2n := sorry

Tactic state before:
case h.h.hf
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
ω : Ω × Ω
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
μ2n : Measure (Fin n → Ω × Ω) := Measure.pi fun x => μ.prod μ
⊢ Integrable
    (fun a =>
      2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (a i).1) - f I (X (a i).2)) + (f I (X ω.2) - f I (X ω.1) + c I))
    μ2n

Tactic:
apply integrable₁ ω.swap h𝓕 h𝓕' hC

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_155.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n : ℕ} (ω : Ω × Ω)
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C) :
  let μ2n := Measure.pi fun x => μ.prod μ;
  Integrable
    (fun a =>
      2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (a i).1) - f I (X (a i).2)) + (f I (X ω.1) - f I (X ω.2) + c I))
    μ2n := sorry

Tactic state before:
case h.h.hg
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
ω : Ω × Ω
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
μ2n : Measure (Fin n → Ω × Ω) := Measure.pi fun x => μ.prod μ
⊢ Integrable
    (fun a =>
      2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (a i).1) - f I (X (a i).2)) + (f I (X ω.1) - f I (X ω.2) + c I))
    μ2n

Tactic:
apply integrable₁ ω h𝓕 h𝓕' hC

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_157.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n : ℕ} (ω : Ω × Ω)
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C) :
  let μ2n := Measure.pi fun x => μ.prod μ;
  ∫ (x : Fin n → Ω × Ω),
      (fun ω' =>
          2⁻¹ *
            ((2⁻¹ ^ n *
                ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.2) - f I (X ω.1) + c I)) +
              2⁻¹ ^ n *
                ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.1) - f I (X ω.2) + c I)))
        x ∂μ2n =
    2⁻¹ *
      ∫ (x : Fin n → Ω × Ω),
        (fun ω' =>
            (2⁻¹ ^ n *
                ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.2) - f I (X ω.1) + c I)) +
              2⁻¹ ^ n *
                ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.1) - f I (X ω.2) + c I))
          x ∂μ2n := sorry

Tactic state before:
case h
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
ω : Ω × Ω
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
μ2n : Measure (Fin n → Ω × Ω) := Measure.pi fun x => μ.prod μ
⊢ ∫ (x : Fin n → Ω × Ω),
      (fun ω' =>
          2⁻¹ *
            ((2⁻¹ ^ n *
                ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.2) - f I (X ω.1) + c I)) +
              2⁻¹ ^ n *
                ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.1) - f I (X ω.2) + c I)))
        x ∂μ2n =
    2⁻¹ *
      ∫ (x : Fin n → Ω × Ω),
        (fun ω' =>
            (2⁻¹ ^ n *
                ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.2) - f I (X ω.1) + c I)) +
              2⁻¹ ^ n *
                ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.1) - f I (X ω.2) + c I))
          x ∂μ2n

Tactic:
apply integral_mul_left

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

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

Tactic state before:
case h.h
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
ω : Ω × Ω
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
μ2n : Measure (Fin n → Ω × Ω) := Measure.pi fun x => μ.prod μ
ω' : Fin n → Ω × Ω
⊢ 2⁻¹ *
      ((2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.2) - f I (X ω.1) + c I)) +
        2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.1) - f I (X ω.2) + c I)) =
    2⁻¹ ^ (n + 1) *
      ∑ σ, ⨆ I, ∑ i, ↑↑(σ ↑↑i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (↑↑(σ ↑n) * (f I (X ω.1) - f I (X ω.2)) + c I)

Tactic:
exact inineq ω ω'

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_160.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n : ℕ}
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) (c : ι → ℝ) :
  (∃ C, ∀ (I : ι), |c I| ≤ C) →
    (∫ (x : Fin 0 → Ω × Ω),
        (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
      ∫ (x : Fin 0 → Ω × Ω),
        (fun ω => 2⁻¹ ^ 0 * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
          x ∂Measure.pi fun x => μ.prod μ := sorry

Tactic state before:
case zero
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n : ℕ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
⊢ ∀ (c : ι → ℝ),
    (∃ C, ∀ (I : ι), |c I| ≤ C) →
      (∫ (x : Fin 0 → Ω × Ω),
          (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
        ∫ (x : Fin 0 → Ω × Ω),
          (fun ω => 2⁻¹ ^ 0 * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
            x ∂Measure.pi fun x => μ.prod μ

Tactic:
simp

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_161.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n_1 : ℕ}
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) (n : ℕ)
  (ih :
    ∀ (c : ι → ℝ),
      (∃ C, ∀ (I : ι), |c I| ≤ C) →
        (∫ (x : Fin n → Ω × Ω),
            (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
          ∫ (x : Fin n → Ω × Ω),
            (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
              x ∂Measure.pi fun x => μ.prod μ)
  (c : ι → ℝ) (C : ℝ) (hC : ∀ (I : ι), |c I| ≤ C) :
  let μ2n := Measure.pi fun x => μ.prod μ;
  (∫ (x : Fin (n + 1) → Ω × Ω),
      (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
    ∫ (x : Fin (n + 1) → Ω × Ω),
      (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
        x ∂Measure.map (⇑(Fin.snocEquiv fun x => Ω × Ω)) ((μ.prod μ).prod μ2n) := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n✝ : ℕ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
n : ℕ
ih :
  ∀ (c : ι → ℝ),
    (∃ C, ∀ (I : ι), |c I| ≤ C) →
      (∫ (x : Fin n → Ω × Ω),
          (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
        ∫ (x : Fin n → Ω × Ω),
          (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
            x ∂Measure.pi fun x => μ.prod μ
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
μ2n : Measure (Fin n → Ω × Ω) := Measure.pi fun x => μ.prod μ
⊢ (∫ (x : Fin (n + 1) → Ω × Ω),
      (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
    ∫ (x : Fin (n + 1) → Ω × Ω),
      (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
        x ∂Measure.map (⇑(Fin.snocEquiv fun x => Ω × Ω)) ((μ.prod μ).prod μ2n)

Tactic:
rw [measure_equiv]

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_164.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n_1 : ℕ}
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) (n : ℕ)
  (ih :
    ∀ (c : ι → ℝ),
      (∃ C, ∀ (I : ι), |c I| ≤ C) →
        (∫ (x : Fin n → Ω × Ω),
            (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
          ∫ (x : Fin n → Ω × Ω),
            (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
              x ∂Measure.pi fun x => μ.prod μ)
  (c : ι → ℝ) (C : ℝ) (hC : ∀ (I : ι), |c I| ≤ C) :
  let μ2n := Measure.pi fun x => μ.prod μ;
  AEMeasurable (⇑(Fin.snocEquiv fun x => Ω × Ω)) ((μ.prod μ).prod μ2n) →
    Measurable ⇑(Fin.snocEquiv fun x => Ω × Ω) := sorry

Tactic state before:
case hφ
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n✝ : ℕ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
n : ℕ
ih :
  ∀ (c : ι → ℝ),
    (∃ C, ∀ (I : ι), |c I| ≤ C) →
      (∫ (x : Fin n → Ω × Ω),
          (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
        ∫ (x : Fin n → Ω × Ω),
          (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
            x ∂Measure.pi fun x => μ.prod μ
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
μ2n : Measure (Fin n → Ω × Ω) := Measure.pi fun x => μ.prod μ
⊢ AEMeasurable (⇑(Fin.snocEquiv fun x => Ω × Ω)) ((μ.prod μ).prod μ2n)

Tactic:
apply Measurable.aemeasurable

Tactic state after:
[case hφ.h
 Z : Type w
 ι : Type v
 f : ι → Z → ℝ
 Ω : Type u
 inst✝³ : MeasurableSpace Ω
 X : Ω → Z
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 n✝ : ℕ
 inst✝¹ : Countable ι
 inst✝ : Nonempty ι
 h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
 b : ℝ
 h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
 n : ℕ
 ih :
   ∀ (c : ι → ℝ),
     (∃ C, ∀ (I : ι), |c I| ≤ C) →
       (∫ (x : Fin n → Ω × Ω),
           (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
         ∫ (x : Fin n → Ω × Ω),
           (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
             x ∂Measure.pi fun x => μ.prod μ
 c : ι → ℝ
 C : ℝ
 hC : ∀ (I : ι), |c I| ≤ C
 μ2n : Measure (Fin n → Ω × Ω) := Measure.pi fun x => μ.prod μ
 ⊢ Measurable ⇑(Fin.snocEquiv fun x => Ω × Ω)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_165.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {n_1 : ℕ}
  [inst_2 : Countable ι] [inst_3 : Nonempty ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) (n : ℕ)
  (ih :
    ∀ (c : ι → ℝ),
      (∃ C, ∀ (I : ι), |c I| ≤ C) →
        (∫ (x : Fin n → Ω × Ω),
            (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
          ∫ (x : Fin n → Ω × Ω),
            (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
              x ∂Measure.pi fun x => μ.prod μ)
  (c : ι → ℝ) (C : ℝ) (hC : ∀ (I : ι), |c I| ≤ C) : Measurable fun f x => Fin.snoc f.2 f.1 x := sorry

Tactic state before:
case hφ.h
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝³ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
n✝ : ℕ
inst✝¹ : Countable ι
inst✝ : Nonempty ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
n : ℕ
ih :
  ∀ (c : ι → ℝ),
    (∃ C, ∀ (I : ι), |c I| ≤ C) →
      (∫ (x : Fin n → Ω × Ω),
          (fun ω => ⨆ I, ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) + c I) x ∂Measure.pi fun x => μ.prod μ) =
        ∫ (x : Fin n → Ω × Ω),
          (fun ω => 2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + c I)
            x ∂Measure.pi fun x => μ.prod μ
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
μ2n : Measure (Fin n → Ω × Ω) := Measure.pi fun x => μ.prod μ
⊢ Measurable fun f x => Fin.snoc f.2 f.1 x

Tactic:
exact measurable_snocEquiv

Tactic state after: