zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_52.{u_3, u_2, u_1} {Ω : Type u_1} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] {𝓧 : Type u_2} {ι : Type u_3} [inst_2 : DecidableEq ι] {m𝓧 : MeasurableSpace 𝓧}
  [hnonempty𝓧 : Nonempty 𝓧] [inst_3 : Fintype ι] (X_1 : ι → Ω → 𝓧) (hX : ∀ (i : ι), Measurable (X_1 i))
  (hX' : iIndepFun X_1 μ) (f : (ι → 𝓧) → ℝ) (c : ι → ℝ)
  (hf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |f x - f (Function.update x i x')| ≤ c i) (hf' : Measurable f) (t : ℝ)
  (ht' : t * ∑ i, c i ^ 2 ≤ 1) :
  let m := Fintype.card ι;
  let ιm := Fintype.equivFinOfCardEq rfl;
  ∀ (X : Fin m → 𝓧) (k : Fin m) (x : 𝓧) (i : ι),
    ¬k = ιm i →
      Function.update X k x (ιm i) = Function.update (X ∘ ⇑ιm) (ιm.symm k) x i → X (ιm i) = (X ∘ ⇑ιm) i := sorry

Tactic state before:
Ω : Type u_1
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
𝓧 : Type u_2
ι : Type u_3
inst✝¹ : DecidableEq ι
m𝓧 : MeasurableSpace 𝓧
hnonempty𝓧 : Nonempty 𝓧
inst✝ : Fintype ι
X✝ : ι → Ω → 𝓧
hX : ∀ (i : ι), Measurable (X✝ i)
hX' : iIndepFun X✝ μ
f : (ι → 𝓧) → ℝ
c : ι → ℝ
hf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |f x - f (Function.update x i x')| ≤ c i
hf' : Measurable f
ε : ℝ
hε : ε > 0
t : ℝ
ht' : t * ∑ i, c i ^ 2 ≤ 1
m : ℕ := Fintype.card ι
ιm : ι ≃ Fin m := Fintype.equivFinOfCardEq ⋯
X' : Fin m → Ω → 𝓧 := X✝ ∘ ⇑ιm.symm
f' : (Fin m → 𝓧) → ℝ := f ∘ fun s => s ∘ ⇑ιm
c' : Fin m → ℝ := c ∘ ⇑ιm.symm
X : Fin m → 𝓧
k : Fin m
x : 𝓧
i : ι
h : ¬k = ιm i
⊢ Function.update X k x (ιm i) = Function.update (X ∘ ⇑ιm) (ιm.symm k) x i

Tactic:
rw [Function.update_of_ne (fun a ↦ h (id (Eq.symm a)))]
    have : ιm.symm k ≠ i := fun a ↦ h ((Equiv.symm_apply_eq ιm).mp a)
    rw [Function.update_of_ne (id (Ne.symm this))]

Tactic state after:
[Ω : Type u_1
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 𝓧 : Type u_2
 ι : Type u_3
 inst✝¹ : DecidableEq ι
 m𝓧 : MeasurableSpace 𝓧
 hnonempty𝓧 : Nonempty 𝓧
 inst✝ : Fintype ι
 X✝ : ι → Ω → 𝓧
 hX : ∀ (i : ι), Measurable (X✝ i)
 hX' : iIndepFun X✝ μ
 f : (ι → 𝓧) → ℝ
 c : ι → ℝ
 hf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |f x - f (Function.update x i x')| ≤ c i
 hf' : Measurable f
 ε : ℝ
 hε : ε > 0
 t : ℝ
 ht' : t * ∑ i, c i ^ 2 ≤ 1
 m : ℕ := Fintype.card ι
 ιm : ι ≃ Fin m := Fintype.equivFinOfCardEq ⋯
 X' : Fin m → Ω → 𝓧 := X✝ ∘ ⇑ιm.symm
 f' : (Fin m → 𝓧) → ℝ := f ∘ fun s => s ∘ ⇑ιm
 c' : Fin m → ℝ := c ∘ ⇑ιm.symm
 X : Fin m → 𝓧
 k : Fin m
 x : 𝓧
 i : ι
 h : ¬k = ιm i
 this : ιm.symm k ≠ i
 ⊢ X (ιm i) = (X ∘ ⇑ιm) i]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_53.{u_3, u_2, u_1} {Ω : Type u_1} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] {𝓧 : Type u_2} {ι : Type u_3} [inst_2 : DecidableEq ι] {m𝓧 : MeasurableSpace 𝓧}
  [hnonempty𝓧 : Nonempty 𝓧] [inst_3 : Fintype ι] (X : ι → Ω → 𝓧) (hX : ∀ (i : ι), Measurable (X i))
  (hX' : iIndepFun X μ) (f : (ι → 𝓧) → ℝ) (c : ι → ℝ)
  (hf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |f x - f (Function.update x i x')| ≤ c i) (hf' : Measurable f) (ε : ℝ)
  (hε : ε > 0) (t : ℝ) (ht' : t * ∑ i, c i ^ 2 ≤ 1) :
  let m := Fintype.card ι;
  let ιm := Fintype.equivFinOfCardEq rfl;
  let X' := X ∘ ⇑ιm.symm;
  let f' := f ∘ fun s => s ∘ ⇑ιm;
  let c' := c ∘ ⇑ιm.symm;
  (∀ (X : Fin m → 𝓧) (k : Fin m) (x : 𝓧), Function.update X k x ∘ ⇑ιm = Function.update (X ∘ ⇑ιm) (ιm.symm k) x) →
    (∀ (i : Fin m) (x : Fin m → 𝓧) (x' : 𝓧), |f' x - f' (Function.update x i x')| ≤ c' i) →
      StronglyMeasurable f' →
        iIndepFun X' μ →
          (∀ (i : Fin m), Measurable (X (ιm.symm i))) →
            t * ∑ i', c' i' ^ 2 ≤ 1 →
              ¬t ≥ 0 →
                (μ fun ω => (f ∘ Function.swap X) ω - ∫ (x : Ω), (f ∘ Function.swap X) x ∂μ ≥ ε).toReal ≤
                  ENNReal.toReal 1 := sorry

Tactic state before:
Ω : Type u_1
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
𝓧 : Type u_2
ι : Type u_3
inst✝¹ : DecidableEq ι
m𝓧 : MeasurableSpace 𝓧
hnonempty𝓧 : Nonempty 𝓧
inst✝ : Fintype ι
X : ι → Ω → 𝓧
hX : ∀ (i : ι), Measurable (X i)
hX' : iIndepFun X μ
f : (ι → 𝓧) → ℝ
c : ι → ℝ
hf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |f x - f (Function.update x i x')| ≤ c i
hf' : Measurable f
ε : ℝ
hε : ε > 0
t : ℝ
ht' : t * ∑ i, c i ^ 2 ≤ 1
m : ℕ := Fintype.card ι
ιm : ι ≃ Fin m := Fintype.equivFinOfCardEq ⋯
X' : Fin m → Ω → 𝓧 := X ∘ ⇑ιm.symm
f' : (Fin m → 𝓧) → ℝ := f ∘ fun s => s ∘ ⇑ιm
c' : Fin m → ℝ := c ∘ ⇑ιm.symm
hequpdate : ∀ (X : Fin m → 𝓧) (k : Fin m) (x : 𝓧), Function.update X k x ∘ ⇑ιm = Function.update (X ∘ ⇑ιm) (ιm.symm k) x
hfι : ∀ (i : Fin m) (x : Fin m → 𝓧) (x' : 𝓧), |f' x - f' (Function.update x i x')| ≤ c' i
hf'' : StronglyMeasurable f'
hIndep' : iIndepFun X' μ
hX'' : ∀ (i : Fin m), Measurable (X (ιm.symm i))
ht'' : t * ∑ i', c' i' ^ 2 ≤ 1
ht : ¬t ≥ 0
⊢ (μ fun ω => (f ∘ Function.swap X) ω - ∫ (x : Ω), (f ∘ Function.swap X) x ∂μ ≥ ε).toReal ≤ ENNReal.toReal 1

Tactic:
apply ENNReal.toReal_mono
    exact ENNReal.one_ne_top
    apply MeasureTheory.prob_le_one

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_56.{u_3, u_2, u_1} {Ω : Type u_1} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] {𝓧 : Type u_2} {ι : Type u_3} [inst_2 : DecidableEq ι] {m𝓧 : MeasurableSpace 𝓧}
  [hnonempty𝓧 : Nonempty 𝓧] [inst_3 : Fintype ι] (X : ι → Ω → 𝓧) (hX : ∀ (i : ι), Measurable (X i))
  (hX' : iIndepFun X μ) (f : (ι → 𝓧) → ℝ) (c : ι → ℝ)
  (hf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |f x - f (Function.update x i x')| ≤ c i) (hf' : Measurable f) (t : ℝ)
  (ht' : t * ∑ i, c i ^ 2 ≤ 1) (i : ι) (x : ι → 𝓧) (x' : 𝓧)
  (h_original_goal : |(-f) x - (-f) (Function.update x i x')| ≤ c i) :
  |f x + -f (Function.update x i x')| ≤ c i := sorry

Tactic state before:
Ω : Type u_1
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
𝓧 : Type u_2
ι : Type u_3
inst✝¹ : DecidableEq ι
m𝓧 : MeasurableSpace 𝓧
hnonempty𝓧 : Nonempty 𝓧
inst✝ : Fintype ι
X : ι → Ω → 𝓧
hX : ∀ (i : ι), Measurable (X i)
hX' : iIndepFun X μ
f : (ι → 𝓧) → ℝ
c : ι → ℝ
hf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |f x - f (Function.update x i x')| ≤ c i
hf' : Measurable f
ε : ℝ
hε : ε > 0
t : ℝ
ht' : t * ∑ i, c i ^ 2 ≤ 1
i : ι
x : ι → 𝓧
x' : 𝓧
⊢ |(-f) x - (-f) (Function.update x i x')| ≤ c i

Tactic:
rw [← abs_neg]
    simp only [Pi.neg_apply, sub_neg_eq_add, neg_add_rev, neg_neg]
    rw [add_comm]

Tactic state after:
[Ω : Type u_1
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 𝓧 : Type u_2
 ι : Type u_3
 inst✝¹ : DecidableEq ι
 m𝓧 : MeasurableSpace 𝓧
 hnonempty𝓧 : Nonempty 𝓧
 inst✝ : Fintype ι
 X : ι → Ω → 𝓧
 hX : ∀ (i : ι), Measurable (X i)
 hX' : iIndepFun X μ
 f : (ι → 𝓧) → ℝ
 c : ι → ℝ
 hf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |f x - f (Function.update x i x')| ≤ c i
 hf' : Measurable f
 ε : ℝ
 hε : ε > 0
 t : ℝ
 ht' : t * ∑ i, c i ^ 2 ≤ 1
 i : ι
 x : ι → 𝓧
 x' : 𝓧
 ⊢ |f x + -f (Function.update x i x')| ≤ c i]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_57.{u_3, u_2, u_1} {Ω : Type u_1} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] {𝓧 : Type u_2} {ι : Type u_3} [inst_2 : DecidableEq ι] {m𝓧 : MeasurableSpace 𝓧}
  [hnonempty𝓧 : Nonempty 𝓧] [inst_3 : Fintype ι] (X : ι → Ω → 𝓧) (hX : ∀ (i : ι), Measurable (X i))
  (hX' : iIndepFun X μ) (f : (ι → 𝓧) → ℝ) (c : ι → ℝ)
  (hf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |f x - f (Function.update x i x')| ≤ c i) (hf' : Measurable f) (t : ℝ)
  (ht' : t * ∑ i, c i ^ 2 ≤ 1) (hmf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |(-f) x - (-f) (Function.update x i x')| ≤ c i)
  (hmf' : Measurable (-f)) (ω : Ω) :
  ((-f) ∘ Function.swap X) ω - ∫ (a : Ω), ((-f) ∘ Function.swap X) a ∂μ =
    -((f ∘ Function.swap X) ω - ∫ (a : Ω), (f ∘ Function.swap X) a ∂μ) := sorry

Tactic state before:
Ω : Type u_1
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
𝓧 : Type u_2
ι : Type u_3
inst✝¹ : DecidableEq ι
m𝓧 : MeasurableSpace 𝓧
hnonempty𝓧 : Nonempty 𝓧
inst✝ : Fintype ι
X : ι → Ω → 𝓧
hX : ∀ (i : ι), Measurable (X i)
hX' : iIndepFun X μ
f : (ι → 𝓧) → ℝ
c : ι → ℝ
hf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |f x - f (Function.update x i x')| ≤ c i
hf' : Measurable f
ε : ℝ
hε : ε > 0
t : ℝ
ht' : t * ∑ i, c i ^ 2 ≤ 1
hmf : ∀ (i : ι) (x : ι → 𝓧) (x' : 𝓧), |(-f) x - (-f) (Function.update x i x')| ≤ c i
hmf' : Measurable (-f)
ω : Ω
⊢ ((-f) ∘ Function.swap X) ω - ∫ (a : Ω), ((-f) ∘ Function.swap X) a ∂μ =
    -((f ∘ Function.swap X) ω - ∫ (a : Ω), (f ∘ Function.swap X) a ∂μ)

Tactic:
simp only [Function.comp_apply, Pi.neg_apply, neg_sub]
    rw [integral_neg]
    ring_nf

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_0.{u} {Ω : Type u} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] {n : ℕ} (s : Fin (n + 1) → Set Ω) (hs : ∀ (i : Fin (n + 1)), MeasurableSet (s i))
  (ω : Ω × (Fin n → Ω))
  (h_original_goal :
    ω ∈ (fun f x => Fin.snoc f.2 f.1 x) ⁻¹' Set.univ.pi s ↔ ω ∈ s (Fin.last n) ×ˢ Set.univ.pi (s ∘ Fin.castSucc)) :
  (ω.1 ∈ s (Fin.last n) ∧ ∀ (i : Fin n), ω.2 i ∈ s i.castSucc) → ∀ (i : Fin (n + 1)), Fin.snoc ω.2 ω.1 i ∈ s i := sorry

Tactic state before:
case h
Ω : Type u
inst✝¹ : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
n : ℕ
s : Fin (n + 1) → Set Ω
hs : ∀ (i : Fin (n + 1)), MeasurableSet (s i)
ω : Ω × (Fin n → Ω)
⊢ ω ∈ (fun f x => Fin.snoc f.2 f.1 x) ⁻¹' Set.univ.pi s ↔ ω ∈ s (Fin.last n) ×ˢ Set.univ.pi (s ∘ Fin.castSucc)

Tactic:
simp only [Set.mem_preimage, Set.mem_pi, Set.mem_univ, forall_const, Set.mem_prod, Function.comp_apply]
    constructor
    ·
  intro h
  have := h (Fin.last n)
  to_theorem rw [Fin.snoc_last] at this use this intro i
  have := h i.castSucc
  rw [Fin.snoc_castSucc] at this
  exact this

Tactic state after:
[case h.mpr
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 n : ℕ
 s : Fin (n + 1) → Set Ω
 hs : ∀ (i : Fin (n + 1)), MeasurableSet (s i)
 ω : Ω × (Fin n → Ω)
 ⊢ (ω.1 ∈ s (Fin.last n) ∧ ∀ (i : Fin n), ω.2 i ∈ s i.castSucc) → ∀ (i : Fin (n + 1)), Fin.snoc ω.2 ω.1 i ∈ s i]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_1.{u} {Ω : Type u} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] {n : ℕ} (s : Fin (n + 1) → Set Ω) (hs : ∀ (i : Fin (n + 1)), MeasurableSet (s i))
  (ω : Ω × (Fin n → Ω)) (h₁ : ω.1 ∈ s (Fin.last n)) (h₂ : ∀ (i : Fin n), ω.2 i ∈ s i.castSucc) (i : Fin (n + 1))
  (h : ¬↑i < n) (h_original_goal : (if h : ↑i < n then ω.2 (i.castLT h) else ω.1) ∈ s i) : ω.1 ∈ s (Fin.last n) := sorry

Tactic state before:
Ω : Type u
inst✝¹ : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
n : ℕ
s : Fin (n + 1) → Set Ω
hs : ∀ (i : Fin (n + 1)), MeasurableSet (s i)
ω : Ω × (Fin n → Ω)
h₁ : ω.1 ∈ s (Fin.last n)
h₂ : ∀ (i : Fin n), ω.2 i ∈ s i.castSucc
i : Fin (n + 1)
h : ¬↑i < n
⊢ (if h : ↑i < n then ω.2 (i.castLT h) else ω.1) ∈ s i

Tactic:
rw [dif_neg h]
    have : i = Fin.last n := Fin.eq_last_of_not_lt h
    rw [this]

Tactic state after:
[Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 n : ℕ
 s : Fin (n + 1) → Set Ω
 hs : ∀ (i : Fin (n + 1)), MeasurableSet (s i)
 ω : Ω × (Fin n → Ω)
 h₁ : ω.1 ∈ s (Fin.last n)
 h₂ : ∀ (i : Fin n), ω.2 i ∈ s i.castSucc
 i : Fin (n + 1)
 h : ¬↑i < n
 this : i = Fin.last n
 ⊢ ω.1 ∈ s (Fin.last n)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_2.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} {X : Ω → Z} {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C) (ω : Ω × Ω)
  (σ : { x // x ∈ {-1, 1} }) (I : ι) (h_original_goal : |↑↑σ * (f I (X ω.1) - f I (X ω.2))| + |c I| ≤ b + b + |c I|) :
  |f I (X ω.1) - f I (X ω.2)| ≤ b + b := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
X : Ω → Z
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
ω : Ω × Ω
σ : { x // x ∈ {-1, 1} }
I : ι
⊢ |↑↑σ * (f I (X ω.1) - f I (X ω.2))| + |c I| ≤ b + b + |c I|

Tactic:
apply add_le_add_right
    rw [abs_mul, abs_sigma σ]
    simp only [one_mul]

Tactic state after:
[case bc
 Z : Type w
 ι : Type v
 f : ι → Z → ℝ
 Ω : Type u
 X : Ω → Z
 b : ℝ
 h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
 c : ι → ℝ
 C : ℝ
 hC : ∀ (I : ι), |c I| ≤ C
 ω : Ω × Ω
 σ : { x // x ∈ {-1, 1} }
 I : ι
 ⊢ |f I (X ω.1) - f I (X ω.2)| ≤ b + b]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_3.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} {μ : Measure Ω} {n : ℕ} (ω : Ω × Ω) {b : ℝ}
  (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) {c : ι → ℝ} {C : ℝ} (hC : ∀ (I : ι), |c I| ≤ C)
  (ih :
    ∀ (c : ι → ℝ),
      (∃ C, ∀ (I : ι), |c I| ≤ C) →
        (∫ (ω' : Fin n → Ω × Ω), ⨆ I, ∑ i, (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I ∂Measure.pi fun x => μ.prod μ) =
          ∫ (ω' : Fin n → Ω × Ω),
            2⁻¹ ^ n *
              ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I ∂Measure.pi fun x => μ.prod μ) :
  let μ2n := Measure.pi fun x => μ.prod μ;
  ∫ (x : Fin n → Ω × Ω),
      (fun ω' => ⨆ I, ∑ i, (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.1) - f I (X ω.2) + c I)) x ∂μ2n =
    ∫ (x : Fin n → Ω × Ω),
      (fun ω' =>
          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:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝ : MeasurableSpace Ω
X : Ω → Z
μ : Measure Ω
n : ℕ
ω : Ω × Ω
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
ih :
  ∀ (c : ι → ℝ),
    (∃ C, ∀ (I : ι), |c I| ≤ C) →
      (∫ (ω' : Fin n → Ω × Ω), ⨆ I, ∑ i, (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I ∂Measure.pi fun x => μ.prod μ) =
        ∫ (ω' : Fin n → Ω × Ω),
          2⁻¹ ^ n * ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + c I ∂Measure.pi fun x => μ.prod μ
⊢ let μ2n := Measure.pi fun x => μ.prod μ;
  ∫ (x : Fin n → Ω × Ω),
      (fun ω' => ⨆ I, ∑ i, (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.1) - f I (X ω.2) + c I)) x ∂μ2n =
    ∫ (x : Fin n → Ω × Ω),
      (fun ω' =>
          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 ih (fun I ↦ (f I (X ω.1) - f I (X ω.2)) + c I)
    use b + b + C
    exact boundedness₀ h𝓕' hC ω

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_4.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} {X : Ω → Z} {n : ℕ}
  (ω : Ω × Ω) (ω' : Fin n → Ω × Ω) {c : ι → ℝ}
  (h_original_goal :
    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) *
        ∑ σ' ∈ {-1, 1},
          ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (↑σ' * (f I (X ω.1) - f I (X ω.2)) + c I)) :
  2⁻¹ * (2 ^ n)⁻¹ = (2 ^ (n + 1))⁻¹ := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
X : Ω → Z
n : ℕ
ω : Ω × Ω
ω' : Fin n → Ω × Ω
c : ι → ℝ
⊢ 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) *
      ∑ σ' ∈ {-1, 1},
        ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (↑σ' * (f I (X ω.1) - f I (X ω.2)) + c I)

Tactic:
rw [← mul_add, ← mul_assoc]
    simp only [inv_pow, Int.reduceNeg, Finset.mem_singleton, reduceCtorEq, not_false_eq_true, Finset.sum_insert,
  Int.cast_neg, Int.cast_one, neg_mul, one_mul, neg_sub, Finset.sum_singleton, mul_eq_mul_right_iff]
    left

Tactic state after:
[case h
 Z : Type w
 ι : Type v
 f : ι → Z → ℝ
 Ω : Type u
 X : Ω → Z
 n : ℕ
 ω : Ω × Ω
 ω' : Fin n → Ω × Ω
 c : ι → ℝ
 ⊢ 2⁻¹ * (2 ^ n)⁻¹ = (2 ^ (n + 1))⁻¹]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_5.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} {X : Ω → Z} {n : ℕ}
  (ω : Ω × Ω) (ω' : Fin n → Ω × Ω) {c : ι → ℝ} :
  2⁻¹ ^ (n + 1) *
      ∑ σ' ∈ {-1, 1},
        ∑ σ, ⨆ 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:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
X : Ω → Z
n : ℕ
ω : Ω × Ω
ω' : Fin n → Ω × Ω
c : ι → ℝ
⊢ 2⁻¹ ^ (n + 1) *
      ∑ σ' ∈ {-1, 1},
        ∑ σ, ⨆ 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:
rw [sigma_eq]
    simp only [inv_pow, Int.reduceNeg, Fin.natCast_eq_last, Fin.coe_eq_castSucc, mul_eq_mul_left_iff, inv_eq_zero,
  ne_eq, AddLeftCancelMonoid.add_eq_zero, one_ne_zero, and_false, not_false_eq_true, pow_eq_zero_iff,
  OfNat.ofNat_ne_zero, or_false]
    rfl

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_6.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} [inst_1 : Countable ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {n : ℕ} {I : ι}
  {i : Fin n} : Measurable fun ω => f I (X (ω i).1) - f I (X (ω i).2) := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝¹ : MeasurableSpace Ω
X : Ω → Z
inst✝ : Countable ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
n : ℕ
I : ι
i : Fin n
⊢ Measurable fun ω => f I (X (ω i).1) - f I (X (ω i).2)

Tactic:
apply Measurable.sub
    ·
  apply (h𝓕 I).comp
  apply measurable_fst.comp
  exact measurable_pi_apply i
    ·
  apply (h𝓕 I).comp
  apply measurable_snd.comp
  exact measurable_pi_apply i

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_7.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u}
  [inst : MeasurableSpace Ω] {X : Ω → Z} [inst_1 : Countable ι] (h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)) {n : ℕ} {I : ι} :
  Measurable fun ω => ∑ i, (f I (X (ω i).1) - f I (X (ω i).2)) := sorry

Tactic state before:
Z : Type w
ι : Type v
f : ι → Z → ℝ
Ω : Type u
inst✝¹ : MeasurableSpace Ω
X : Ω → Z
inst✝ : Countable ι
h𝓕 : ∀ (I : ι), Measurable (f I ∘ X)
n : ℕ
I : ι
⊢ Measurable fun ω => ∑ i, (f I (X (ω i).1) - f I (X (ω i).2))

Tactic:
apply Finset.measurable_sum Finset.univ
    intro i _
    exact measurable_sub_part h𝓕

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_8.{v} {ι : Type v} [inst : Nonempty ι] {f : ι → ℝ} {a : ℝ} (hf : ∀ (i : ι), |f i| ≤ a)
  (hbdd : BddAbove (Set.range f)) (h_original_goal : |⨆ i, f i| ≤ a) : ⨆ i, f i ≤ a := sorry

Tactic state before:
ι : Type v
inst✝ : Nonempty ι
f : ι → ℝ
a : ℝ
hf : ∀ (i : ι), |f i| ≤ a
hbdd : BddAbove (Set.range f)
⊢ |⨆ i, f i| ≤ a

Tactic:
apply abs_le.mpr
    constructor
    ·
  let i : ι := Nonempty.some (by assumption)
  exact le_trans (abs_le.mp (hf i)).1 (le_ciSup hbdd i)

Tactic state after:
[case right
 ι : Type v
 inst✝ : Nonempty ι
 f : ι → ℝ
 a : ℝ
 hf : ∀ (i : ι), |f i| ≤ a
 hbdd : BddAbove (Set.range f)
 ⊢ ⨆ i, f i ≤ a]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_9.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} {X : Ω → Z} {n : ℕ}
  {b : ℝ} (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) (ω : Fin n → Ω × Ω) (I : ι) :
  ∑ i, |f I (X (ω i).1) - f I (X (ω i).2)| ≤ ∑ i, (b + b) := sorry

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

Tactic:
apply Fintype.sum_mono
    intro i
    exact bound_sub h𝓕'

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

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

Tactic:
apply abs_iSup_le
    intro I
    calc
  _ ≤ |∑ i : Fin n, (f I (X (ω i).1) - f I (X (ω i).2))| + |c I| := by apply abs_add_le
  _ ≤ n * (b + b) + |c I| := by apply add_le_add_right (bound_lem h𝓕' ω I)
  _ ≤ _ := (add_le_add_iff_left (↑n * (b + b))).mpr (hC I)

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_11.{w, v, u} {Z : Type w} {ι : Type v} {f : ι → Z → ℝ} {Ω : Type u} {X : Ω → Z} {n : ℕ}
  {b : ℝ} (h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b) (ω : Fin n → Ω × Ω) (I : ι) (σ : Fin n → { x // x ∈ {-1, 1} })
  (i : Fin n) (this : |↑↑(σ i)| = 1) : |↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2))| ≤ b + b := sorry

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

Tactic:
rw [abs_mul, this]
    simp only [one_mul, ge_iff_le]
    exact bound_sub h𝓕'

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_12.{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} }) :
  |⨆ 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 → Ω × Ω
σ : Fin n → { x // x ∈ {-1, 1} }
⊢ |⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω i).1) - f I (X (ω i).2)) + c I| ≤ ↑n * (b + b) + C

Tactic:
apply abs_iSup_le
    intro I
    calc
  _ ≤ |∑ i : Fin n, (σ i) * (f I (X (ω i).1) - f I (X (ω i).2))| + |c I| := by apply abs_add_le
  _ ≤ n * (b + b) + |c I| := by apply add_le_add_right (bound_lem' h𝓕' ω I σ)
  _ ≤ _ := (add_le_add_iff_left (↑n * (b + b))).mpr (hC I)

Tactic state after: