zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_28 {n : ℕ} (f : ℤ → Signs n → ℝ) :
  ∑ σ' ∈ {-1, 1}, ∑ σ, f σ' σ = ∑ σ, f (↑σ.1) σ.2 := sorry

Tactic state before:
n : ℕ
f : ℤ → Signs n → ℝ
⊢ ∑ σ' ∈ {-1, 1}, ∑ σ, f σ' σ = ∑ σ, f (↑σ.1) σ.2

Tactic:
exact Eq.symm (Fintype.sum_prod_type _)

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_29 {n : ℕ} (f : ℤ → Signs n → ℝ) :
  ∑ σ, f (↑σ.1) σ.2 =
    ∑ σ,
      f (↑((Fin.snocEquiv fun x => { x // x ∈ {-1, 1} }).symm σ).1)
        ((Fin.snocEquiv fun x => { x // x ∈ {-1, 1} }).symm σ).2 := sorry

Tactic state before:
n : ℕ
f : ℤ → Signs n → ℝ
⊢ ∑ σ, f (↑σ.1) σ.2 =
    ∑ σ,
      f (↑((Fin.snocEquiv fun x => { x // x ∈ {-1, 1} }).symm σ).1)
        ((Fin.snocEquiv fun x => { x // x ∈ {-1, 1} }).symm σ).2

Tactic:
exact
  Eq.symm
    (Fintype.sum_equiv (Fin.snocEquiv fun x ↦ { x // x ∈ {-1, 1} }).symm
      (fun x ↦ (fun σ' ↦ f (↑σ'.1) σ'.2) ((Fin.snocEquiv fun x ↦ { x // x ∈ {-1, 1} }).symm x)) (fun x ↦ f (↑x.1) x.2)
      (congrFun rfl))

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_30 {n : ℕ} (f : ℤ → Signs n → ℝ) :
  ∑ σ, (fun σ' => f (↑σ'.1) σ'.2) ((Fin.snocEquiv fun x => { x // x ∈ {-1, 1} }).symm σ) =
    ∑ σ, f (↑(σ ↑n)) (Fin.init σ) := sorry

Tactic state before:
n : ℕ
f : ℤ → Signs n → ℝ
⊢ ∑ σ, (fun σ' => f (↑σ'.1) σ'.2) ((Fin.snocEquiv fun x => { x // x ∈ {-1, 1} }).symm σ) = ∑ σ, f (↑(σ ↑n)) (Fin.init σ)

Tactic:
simp

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

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

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

Tactic:
apply abs_sub

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_32.{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) (ω : Ω × Ω) (I : ι) :
  |f I (X ω.1) - f I (X ω.2) + c I| ≤ |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
b : ℝ
h𝓕' : ∀ (I : ι) (z : Z), |f I z| ≤ b
c : ι → ℝ
C : ℝ
hC : ∀ (I : ι), |c I| ≤ C
ω : Ω × Ω
I : ι
⊢ |f I (X ω.1) - f I (X ω.2) + c I| ≤ |f I (X ω.1) - f I (X ω.2)| + |c I|

Tactic:
apply abs_add_le

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_33.{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) (ω : Ω × Ω) (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
ω : Ω × Ω
I : ι
⊢ |f I (X ω.1) - f I (X ω.2)| + |c I| ≤ b + b + |c I|

Tactic:
apply add_le_add_right

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
 ω : Ω × Ω
 I : ι
 ⊢ |f I (X ω.1) - f I (X ω.2)| ≤ b + b]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_34.{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) (ω : Ω × Ω) (I : ι) :
  |f I (X ω.1) - f I (X ω.2)| ≤ b + b := sorry

Tactic state before:
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
ω : Ω × Ω
I : ι
⊢ |f I (X ω.1) - f I (X ω.2)| ≤ b + b

Tactic:
exact bound_sub h𝓕'

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_35.{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 : ι) :
  |↑↑σ * (f I (X ω.1) - f I (X ω.2)) + c I| ≤ |↑↑σ * (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
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| ≤ |↑↑σ * (f I (X ω.1) - f I (X ω.2))| + |c I|

Tactic:
apply abs_add_le

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_36.{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

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_37.{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))| ≤ b + b) :
  1 * |f I (X ω.1) - f I (X ω.2)| ≤ b + b := sorry

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

Tactic:
rw [abs_mul, abs_sigma σ]

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 : ι
 ⊢ 1 * |f I (X ω.1) - f I (X ω.2)| ≤ b + b]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_38.{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) (ω : Ω × Ω) (I : ι)
  (h_original_goal : 1 * |f I (X ω.1) - f I (X ω.2)| ≤ b + b) : |f I (X ω.1) - f I (X ω.2)| ≤ b + b := sorry

Tactic state before:
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 : ι
⊢ 1 * |f I (X ω.1) - f I (X ω.2)| ≤ b + b

Tactic:
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_39.{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) (ω : Ω × Ω) (I : ι) :
  |f I (X ω.1) - f I (X ω.2)| ≤ b + b := sorry

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

Tactic:
exact bound_sub h𝓕'

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_40.{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 μ)
  (h_original_goal :
    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) :
  ∃ C, ∀ (I : ι), |f I (X ω.1) - f I (X ω.2) + c I| ≤ C := 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)

Tactic state after:
[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 μ
 ⊢ ∃ C, ∀ (I : ι), |f I (X ω.1) - f I (X ω.2) + c I| ≤ C]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_41.{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 μ)
  (I : ι) : |f I (X ω.1) - f I (X ω.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 Ω
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 μ
⊢ ∀ (I : ι), |f I (X ω.1) - f I (X ω.2) + c I| ≤ b + b + C

Tactic:
exact boundedness₀ h𝓕' hC ω

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_42.{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 *
      ((∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.2) - f I (X ω.1) + c I)) +
        ∑ σ, ⨆ 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) := 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]

Tactic state after:
[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)) +
         ∑ σ, ⨆ 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)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_43.{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)) +
          ∑ σ, ⨆ 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))⁻¹ ∨
    (∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.2) - f I (X ω.1) + c I)) +
        ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.1) - f I (X ω.2) + c I) =
      0 := 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)) +
        ∑ σ, ⨆ 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:
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]

Tactic state after:
[Z : Type w
 ι : Type v
 f : ι → Z → ℝ
 Ω : Type u
 X : Ω → Z
 n : ℕ
 ω : Ω × Ω
 ω' : Fin n → Ω × Ω
 c : ι → ℝ
 ⊢ 2⁻¹ * (2 ^ n)⁻¹ = (2 ^ (n + 1))⁻¹ ∨
     (∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.2) - f I (X ω.1) + c I)) +
         ∑ σ, ⨆ I, ∑ i, ↑↑(σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) + (f I (X ω.1) - f I (X ω.2) + c I) =
       0]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

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

Tactic state after:
[Z : Type w
 ι : Type v
 f : ι → Z → ℝ
 Ω : Type u
 X : Ω → Z
 n : ℕ
 ω : Ω × Ω
 ω' : Fin n → Ω × Ω
 c : ι → ℝ
 ⊢ 2⁻¹ ^ (n + 1) *
       ∑ σ,
         ⨆ I,
           ∑ i, ↑↑(Fin.init σ i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) +
             (↑↑(σ ↑n) * (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)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

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

Tactic state after:
[Z : Type w
 ι : Type v
 f : ι → Z → ℝ
 Ω : Type u
 X : Ω → Z
 n : ℕ
 ω : Ω × Ω
 ω' : Fin n → Ω × Ω
 c : ι → ℝ
 ⊢ ∑ x,
       ⨆ I,
         ∑ i, ↑↑(Fin.init x i) * (f I (X (ω' i).1) - f I (X (ω' i).2)) +
           (↑↑(x (Fin.last n)) * (f I (X ω.1) - f I (X ω.2)) + c I) =
     ∑ x,
       ⨆ I,
         ∑ x_1, ↑↑(x x_1.castSucc) * (f I (X (ω' x_1).1) - f I (X (ω' x_1).2)) +
           (↑↑(x (Fin.last n)) * (f I (X ω.1) - f I (X ω.2)) + c I)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_46.{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} (h_original_goal : Measurable fun ω => f I (X (ω i).1) - f I (X (ω i).2)) :
  Measurable fun a => f I (X (a i).1) := 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

Tactic state after:
[case hf
 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 a => f I (X (a i).1),
 case hg
 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 a => f I (X (a i).2)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_47.{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} (h_original_goal : Measurable fun ω => f I (X (ω i).1) - f I (X (ω i).2)) :
  Measurable fun a => f I (X (a 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

Tactic state after:
[case hf
 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 a => f I (X (a i).1),
 case hg
 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 a => f I (X (a i).2)]