zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_14.{u_1, w, u} {Ω : Type u} {Z : Type w} {n : ℕ} {ι : Type u_1} {f : ι → Z → ℝ}
  {X : Ω → Z} {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (ω : Fin n → Ω) (h : Nonempty ι) (i : ι)
  (this : ∑ k, |f i (X (ω k))| ≤ ∑ k, b) : ∑ k, |f i (X (ω k))| ≤ ↑n * b := sorry

Tactic state before:
Ω : Type u
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
X : Ω → Z
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω
h : Nonempty ι
i : ι
this : ∑ k, |f i (X (ω k))| ≤ ∑ k, b
⊢ ∑ k, |f i (X (ω k))| ≤ ↑n * b

Tactic:
apply le_trans this _
    apply le_of_eq
    simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_15.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] [inst_2 : Countable ι] {X : Ω → Z}
  (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b)
  (ω : (Fin n → Ω) × (Fin n → Ω))
  (h_original_goal : ‖(↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω.1 k))|‖ ≤ ↑n * b) :
  2 ^ n * (↑n * b) ≤ ↑n * b * 2 ^ n := sorry

Tactic state before:
case h
Ω : Type u
inst✝² : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : Countable ι
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : (Fin n → Ω) × (Fin n → Ω)
⊢ ‖(↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω.1 k))|‖ ≤ ↑n * b

Tactic:
simp only [Signs.card, Nat.cast_pow, Nat.cast_ofNat, Int.reduceNeg, norm_mul, norm_inv, norm_pow,
  norm_ofNat, norm_eq_abs]
    rw [inv_mul_le_iff₀' (by simp)]
    apply le_trans (integrable_aux2_aux hb hf' _)

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


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_16.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z} [inst_3 : Countable ι]
  (hf : ∀ (i : ι), Measurable (f i ∘ X)) (i : ι)
  (h_original_goal :
    StronglyMeasurable fun x => ∫ (x_1 : Fin n → Ω), ∑ k, (f i (X (x k)) - f i (X (x_1 k))) ∂Measure.pi fun x => μ) :
  Measurable fun p => ∑ k, (f i (X (p.2 k)) - f i (X (p.1 k))) := sorry

Tactic state before:
case hf.left.hf.hf.hg.hf.hf
Ω : Type u
inst✝¹ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
X : Ω → Z
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
i : ι
⊢ StronglyMeasurable fun x => ∫ (x_1 : Fin n → Ω), ∑ k, (f i (X (x k)) - f i (X (x_1 k))) ∂Measure.pi fun x => μ

Tactic:
apply MeasureTheory.StronglyMeasurable.integral_prod_left
    apply Measurable.stronglyMeasurable
    dsimp [Function.uncurry_def]

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


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_17.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {ι : Type u_1}
  [inst_1 : AddCommMonoid Z] [inst_2 : MeasurableSpace Z] [inst_3 : MeasurableAdd₂ Z] {X : Ω → Z} (hX : Measurable X)
  (s : Finset ι) : Measurable fun ω => ∑ k ∈ s, X (ω k) := sorry

Tactic state before:
Ω : Type u
inst✝³ : MeasurableSpace Ω
Z : Type w
ι : Type u_1
inst✝² : AddCommMonoid Z
inst✝¹ : MeasurableSpace Z
inst✝ : MeasurableAdd₂ Z
X : Ω → Z
hX : Measurable X
s : Finset ι
⊢ Measurable fun ω => ∑ k ∈ s, X (ω k)

Tactic:
apply s.measurable_sum
    intro k _
    apply hX.comp (measurable_pi_apply k)

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

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

Tactic:
apply Measurable.sub
    · apply (hf i).comp (measurable_pi_apply k).fst
    · apply (hf i).comp (measurable_pi_apply k).snd

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_19.{u_1, w, u} {Ω : Type u} {Z : Type w} {n : ℕ} {ι : Type u_1} {f : ι → Z → ℝ}
  [inst : Countable ι] {X : Ω → Z} {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (ω : Fin n → Ω × Ω) (σ : Signs n)
  (this : BddAbove (Set.range fun i => ∑ k, |↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|))
  (h_original_goal : BddAbove (Set.range fun i => |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|)) :
  ∃ x, ∀ y ∈ Set.range fun i => |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|, y ≤ x := sorry

Tactic state before:
Ω : Type u
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
inst✝ : Countable ι
X : Ω → Z
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω × Ω
σ : Signs n
this : BddAbove (Set.range fun i => ∑ k, |↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|)
⊢ BddAbove (Set.range fun i => |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|)

Tactic:
rw [bddAbove_def] at this
    have ⟨z, hz⟩ := this
    rw [bddAbove_def]

Tactic state after:
[Ω : Type u
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 inst✝ : Countable ι
 X : Ω → Z
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 σ : Signs n
 this : ∃ x, ∀ y ∈ Set.range fun i => ∑ k, |↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|, y ≤ x
 z : ℝ
 hz : ∀ y ∈ Set.range fun i => ∑ k, |↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|, y ≤ z
 ⊢ ∃ x, ∀ y ∈ Set.range fun i => |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|, y ≤ x]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

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

Tactic:
simp only [Signs.card, Nat.cast_pow, Nat.cast_ofNat, Int.reduceNeg, norm_mul, norm_inv, norm_pow,
  norm_ofNat, norm_eq_abs]
    let ω₁ : Fin n → Ω := fun k ↦ (ω k).1
    let ω₂ : Fin n → Ω := fun k ↦ (ω k).2

Tactic state after:
[case h
 Ω : Type u
 inst✝² : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝¹ : IsProbabilityMeasure μ
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 ω₁ : Fin n → Ω := fun k => (ω k).1
 ω₂ : Fin n → Ω := fun k => (ω k).2
 ⊢ (2 ^ n)⁻¹ * |∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|| ≤ ↑n * (b + b)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_22.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] [inst_2 : Countable ι] {X : Ω → Z}
  (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (ω : Fin n → Ω × Ω)
  (σ : Signs n) (a : σ ∈ Finset.univ)
  (h_original_goal :
    |⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|| ≤
      ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|) :
  0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))| := sorry

Tactic state before:
case h
Ω : Type u
inst✝² : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : Countable ι
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω × Ω
ω₁ : Fin n → Ω := fun k => (ω k).1
ω₂ : Fin n → Ω := fun k => (ω k).2
σ : Signs n
a✝ : σ ∈ Finset.univ
⊢ |⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|| ≤
    ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|

Tactic:
apply Eq.le
    simp only [Int.reduceNeg, abs_eq_self]
    by_cases h : Nonempty ι

Tactic state after:
[case pos
 Ω : Type u
 inst✝² : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝¹ : IsProbabilityMeasure μ
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 ω₁ : Fin n → Ω := fun k => (ω k).1
 ω₂ : Fin n → Ω := fun k => (ω k).2
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 h : Nonempty ι
 ⊢ 0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|,
 case neg
 Ω : Type u
 inst✝² : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝¹ : IsProbabilityMeasure μ
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 ω₁ : Fin n → Ω := fun k => (ω k).1
 ω₂ : Fin n → Ω := fun k => (ω k).2
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 h : ¬Nonempty ι
 ⊢ 0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_23.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] [inst_2 : Countable ι] {X : Ω → Z}
  (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (ω : Fin n → Ω × Ω)
  (σ : Signs n) (a : σ ∈ Finset.univ)
  (h_original_goal :
    |⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|| ≤
      ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|) :
  0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))| := sorry

Tactic state before:
case h
Ω : Type u
inst✝² : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : Countable ι
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω × Ω
ω₁ : Fin n → Ω := fun k => (ω k).1
ω₂ : Fin n → Ω := fun k => (ω k).2
σ : Signs n
a✝ : σ ∈ Finset.univ
⊢ |⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|| ≤
    ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|

Tactic:
apply Eq.le
    simp only [Int.reduceNeg, abs_eq_self]
    by_cases h : Nonempty ι

Tactic state after:
[case pos
 Ω : Type u
 inst✝² : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝¹ : IsProbabilityMeasure μ
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 ω₁ : Fin n → Ω := fun k => (ω k).1
 ω₂ : Fin n → Ω := fun k => (ω k).2
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 h : Nonempty ι
 ⊢ 0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|,
 case neg
 Ω : Type u
 inst✝² : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝¹ : IsProbabilityMeasure μ
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 ω₁ : Fin n → Ω := fun k => (ω k).1
 ω₂ : Fin n → Ω := fun k => (ω k).2
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 h : ¬Nonempty ι
 ⊢ 0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_24.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] [inst_2 : Countable ι] {X : Ω → Z}
  (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (ω : Fin n → Ω × Ω)
  (h_original_goal :
    ∑ σ, ⨆ i, ∑ k, |f i (X (ω k).1) - f i (X (ω k).2)| ≤ ∑ σ, ⨆ i, ∑ k, (|f i (X (ω k).1)| + |f i (X (ω k).2)|)) :
  BddAbove (Set.range fun i => ∑ k, (|f i (X (ω k).1)| + |f i (X (ω k).2)|)) := sorry

Tactic state before:
Ω : Type u
inst✝² : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : Countable ι
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω × Ω
ω₁ : Fin n → Ω := fun k => (ω k).1
ω₂ : Fin n → Ω := fun k => (ω k).2
⊢ ∑ σ, ⨆ i, ∑ k, |f i (X (ω k).1) - f i (X (ω k).2)| ≤ ∑ σ, ⨆ i, ∑ k, (|f i (X (ω k).1)| + |f i (X (ω k).2)|)

Tactic:
apply Finset.sum_le_sum
    intro σ _
    apply ciSup_mono

Tactic state after:
[case h.B
 Ω : Type u
 inst✝² : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝¹ : IsProbabilityMeasure μ
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 ω₁ : Fin n → Ω := fun k => (ω k).1
 ω₂ : Fin n → Ω := fun k => (ω k).2
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 ⊢ BddAbove (Set.range fun i => ∑ k, (|f i (X (ω k).1)| + |f i (X (ω k).2)|)),
 case h.H
 Ω : Type u
 inst✝² : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝¹ : IsProbabilityMeasure μ
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 ω₁ : Fin n → Ω := fun k => (ω k).1
 ω₂ : Fin n → Ω := fun k => (ω k).2
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 ⊢ ∀ (x : ι), ∑ k, |f x (X (ω k).1) - f x (X (ω k).2)| ≤ ∑ k, (|f x (X (ω k).1)| + |f x (X (ω k).2)|)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

Tactic state before:
Ω : Type u
inst✝² : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : Countable ι
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω × Ω
ω₁ : Fin n → Ω := fun k => (ω k).1
ω₂ : Fin n → Ω := fun k => (ω k).2
⊢ ∑ σ, ⨆ i, ∑ k, |f i (X (ω k).1) - f i (X (ω k).2)| ≤ ∑ σ, ⨆ i, ∑ k, (|f i (X (ω k).1)| + |f i (X (ω k).2)|)

Tactic:
apply Finset.sum_le_sum
    intro σ _
    apply ciSup_mono

Tactic state after:
[case h.B
 Ω : Type u
 inst✝² : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝¹ : IsProbabilityMeasure μ
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 ω₁ : Fin n → Ω := fun k => (ω k).1
 ω₂ : Fin n → Ω := fun k => (ω k).2
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 ⊢ BddAbove (Set.range fun i => ∑ k, (|f i (X (ω k).1)| + |f i (X (ω k).2)|)),
 case h.H
 Ω : Type u
 inst✝² : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝¹ : IsProbabilityMeasure μ
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 ω₁ : Fin n → Ω := fun k => (ω k).1
 ω₂ : Fin n → Ω := fun k => (ω k).2
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 ⊢ ∀ (x : ι), ∑ k, |f x (X (ω k).1) - f x (X (ω k).2)| ≤ ∑ k, (|f x (X (ω k).1)| + |f x (X (ω k).2)|)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_26.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] [inst_2 : Countable ι] {X : Ω → Z}
  (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (ω : Fin n → Ω × Ω)
  (σ : Signs n) (a : σ ∈ Finset.univ) (i : ι) :
  ∑ k, |f i (X (ω k).1) - f i (X (ω k).2)| ≤ ∑ k, (|f i (X (ω k).1)| + |f i (X (ω k).2)|) := sorry

Tactic state before:
case h.H
Ω : Type u
inst✝² : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : Countable ι
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω × Ω
ω₁ : Fin n → Ω := fun k => (ω k).1
ω₂ : Fin n → Ω := fun k => (ω k).2
σ : Signs n
a✝ : σ ∈ Finset.univ
i : ι
⊢ ∑ k, |f i (X (ω k).1) - f i (X (ω k).2)| ≤ ∑ k, (|f i (X (ω k).1)| + |f i (X (ω k).2)|)

Tactic:
apply Finset.sum_le_sum
    intro k _
    exact abs_sub (f i (X (ω k).1)) (f i (X (ω k).2))

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

Tactic state before:
Ω : Type u
inst✝² : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : Countable ι
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω × Ω
ω₁ : Fin n → Ω := fun k => (ω k).1
ω₂ : Fin n → Ω := fun k => (ω k).2
⊢ ∑ σ, ⨆ i, ∑ k, (|f i (X (ω k).1)| + |f i (X (ω k).2)|) ≤ 2 ^ n * (↑n * (b + b))

Tactic:
simp only [Finset.sum_const, Finset.card_univ, Signs.card, nsmul_eq_mul, Nat.cast_pow, Nat.cast_ofNat,
  Nat.ofNat_pos, pow_pos, mul_le_mul_left]
    by_cases h : Nonempty ι
    ·
  apply ciSup_le
  intro i
  suffices ∑ k : Fin n, (|f i (X (ω k).1)| + |f i (X (ω k).2)|) ≤ ∑ k : Fin n, (b + b) from
    by
    to_theorem
      apply
        le_trans this
          _ apply le_of_eq simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, smul_add, nsmul_eq_mul]
    ring
  apply Finset.sum_le_sum fun k _ ↦ add_le_add (hf' i (X (ω k).1)) (hf' i (X (ω k).2))

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


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

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

Tactic:
apply le_trans this _
    apply le_of_eq
    simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, smul_add, nsmul_eq_mul]

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


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

Tactic state before:
case neg
Ω : Type u
inst✝² : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝¹ : IsProbabilityMeasure μ
inst✝ : Countable ι
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω × Ω
ω₁ : Fin n → Ω := fun k => (ω k).1
ω₂ : Fin n → Ω := fun k => (ω k).2
h : IsEmpty ι
⊢ ⨆ i, ∑ k, (|f i (X (ω k).1)| + |f i (X (ω k).2)|) ≤ ↑n * (b + b)

Tactic:
simp only [iSup_of_isEmpty]
    apply mul_nonneg (Nat.cast_nonneg n)
    exact Left.add_nonneg hb hb

Tactic state after: