zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_12.{w, v, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ} {ι : Type v}
  {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : Nonempty ι] [inst_2 : IsProbabilityMeasure μ] (hn : 0 < n) (X : Ω → Z)
  (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (i : Fin n)
  (x : Fin n → Z) (x' : Z) :
  let g := fun i => (↑n)⁻¹ * ∑ k, f i (x k) - ∫ (x : Ω), f i (X x) ∂μ;
  let h := fun i_1 => (↑n)⁻¹ * ∑ k, f i_1 (Function.update x i x' k) - ∫ (x : Ω), f i_1 (X x) ∂μ;
  (∀ (a : ι), |∫ (x : Ω), f a (X x) ∂μ| ≤ b) →
    (∀ (j : ι), |g j - h j| ≤ (↑n)⁻¹ * 2 * b) →
      (⨆ i, |g i|) - ⨆ i_1, |h i_1| ≤ (↑n)⁻¹ * 2 * b →
        (⨆ i_1, |h i_1|) - ⨆ i, |g i| = ⨆ i_1, |h i_1| - ⨆ i, |g i| →
          ∀ (y : ℝ) (z : ι), |(↑n)⁻¹ * ∑ k, f z (x k) - ∫ (x : Ω), f z (X x) ∂μ| = y → 0 ≤ ∑ k, b := sorry

Tactic state before:
case refine_4
Ω : Type u
inst✝² : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type v
f : ι → Z → ℝ
μ : Measure Ω
inst✝¹ : Nonempty ι
inst✝ : IsProbabilityMeasure μ
hn : 0 < n
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
i : Fin n
x : Fin n → Z
x' : Z
g : ι → ℝ := fun i => (↑n)⁻¹ * ∑ k, f i (x k) - ∫ (x : Ω), f i (X x) ∂μ
h : ι → ℝ := fun i_1 => (↑n)⁻¹ * ∑ k, f i_1 (Function.update x i x' k) - ∫ (x : Ω), f i_1 (X x) ∂μ
s' : ∀ (a : ι), |∫ (x : Ω), f a (X x) ∂μ| ≤ b
p''' : ∀ (j : ι), |g j - h j| ≤ (↑n)⁻¹ * 2 * b
p : (⨆ i, |g i|) - ⨆ i_1, |h i_1| ≤ (↑n)⁻¹ * 2 * b
p0 : (⨆ i_1, |h i_1|) - ⨆ i, |g i| = ⨆ i_1, |h i_1| - ⨆ i, |g i|
j : ι
y : ℝ
z : ι
hx : |(↑n)⁻¹ * ∑ k, f z (x k) - ∫ (x : Ω), f z (X x) ∂μ| = y
⊢ 0 ≤ ∑ k, b

Tactic:
simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, h, g]
    field_simp
    exact hb

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_0.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  ∀ x ∈ ⋂ i ∈ s, f i,
    ∀ i ∈ Set.univ, ∀ (h : i ∈ s), (x i ∈ if h : i ∈ s then f' i h else Set.univ) → x i ∈ f' i h := sorry

Tactic state before:
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
x : ι → Ω
hx : x ∈ ⋂ i ∈ s, f i
i : ι
a✝ : i ∈ Set.univ
h : i ∈ s
⊢ x i ∈ if h : i ∈ s then f' i h else Set.univ

Tactic:
rw [dif_pos h]
    have := Set.mem_iInter.mp hx i
    have := Set.mem_iInter.mp this h

Tactic state after:
[Ω : Type u_1
 ι : Type u_2
 inst✝³ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Fintype ι
 inst✝ : DecidableEq ι
 s : Finset ι
 f : ι → Set (ι → Ω)
 hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
 f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
 hf' : ∀ (i : ι) (hi : i ∈ s),
   inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
   fun i hi => Classical.choose_spec (hf i hi)
 f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
 x : ι → Ω
 hx : x ∈ ⋂ i ∈ s, f i
 i : ι
 a✝ : i ∈ Set.univ
 h : i ∈ s
 this✝ : x ∈ ⋂ (_ : i ∈ s), f i
 this : x ∈ f i
 ⊢ x i ∈ f' i h]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_1.{u_2, u_1} {Ω : Type u_1} {ι : Type u_2} [inst : MeasurableSpace Ω] {μ : Measure Ω}
  [inst_1 : IsProbabilityMeasure μ] [inst_2 : Fintype ι] [inst_3 : DecidableEq ι] (s : Finset ι) {f : ι → Set (ι → Ω)}
  (hf : ∀ i ∈ s, ∃ s', inst.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i) :
  let f' := fun i hi => Classical.choose (hf i hi);
  let hf' := fun i hi => Classical.choose_spec (hf i hi);
  let f'' := fun i => if h : i ∈ s then f' i h else Set.univ;
  ∀ x ∈ Set.univ.pi f'', ∀ i ∈ s, (x i ∈ if h : i ∈ s then f' i h else Set.univ) → x ∈ f i := sorry

Tactic state before:
case h.mpr
Ω : Type u_1
ι : Type u_2
inst✝³ : MeasurableSpace Ω
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
s : Finset ι
f : ι → Set (ι → Ω)
hf : ∀ i ∈ s, ∃ s', inst✝³.MeasurableSet' s' ∧ Function.eval i ⁻¹' s' = f i
f' : (i : ι) → i ∈ s → Set Ω := fun i hi => Classical.choose ⋯
hf' : ∀ (i : ι) (hi : i ∈ s),
  inst✝³.MeasurableSet' (Classical.choose ⋯) ∧ Function.eval i ⁻¹' Classical.choose ⋯ = f i :=
  fun i hi => Classical.choose_spec (hf i hi)
f'' : ι → Set Ω := fun i => if h : i ∈ s then f' i h else Set.univ
x : ι → Ω
hx : x ∈ Set.univ.pi f''
i : ι
hi : i ∈ s
this : x i ∈ if h : i ∈ s then f' i h else Set.univ
⊢ x ∈ f i

Tactic:
rw [dif_pos hi] at this
    rw [← (hf' i hi).2]
    exact this

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_0.{u_2} {ι : Type u_2} [inst : Nonempty ι] {g h : ι → ℝ} (hg : BddAbove (Set.range g))
  (hh : BddAbove (Set.range h)) : ⨆ i, g i + h i ≤ ⨆ i, ⨆ j, g i + h j := sorry

Tactic state before:
ι : Type u_2
inst✝ : Nonempty ι
g h : ι → ℝ
hg : BddAbove (Set.range g)
hh : BddAbove (Set.range h)
⊢ ⨆ i, g i + h i ≤ ⨆ i, ⨆ j, g i + h j

Tactic:
apply ciSup_mono
    ·
  conv in fun i ↦ _ =>
    ext i
    rw [← add_ciSup hh]
  apply BddAbove.range_add hg
  simp
    ·
  intro i
  to_theorem rw [← add_ciSup hh]simp only [add_le_add_iff_left]exact le_ciSup hh i

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_1.{u_2} {ι : Type u_2} [inst : Nonempty ι] {g h : ι → ℝ} (hg : BddAbove (Set.range g))
  (hh : BddAbove (Set.range h)) (i : ι) : g i + h i ≤ ⨆ j, g i + h j := sorry

Tactic state before:
case H
ι : Type u_2
inst✝ : Nonempty ι
g h : ι → ℝ
hg : BddAbove (Set.range g)
hh : BddAbove (Set.range h)
i : ι
⊢ g i + h i ≤ ⨆ j, g i + h j

Tactic:
rw [← add_ciSup hh]
    simp only [add_le_add_iff_left]
    exact le_ciSup hh i

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_2.{u_1, w, u} {Ω : Type u} {Z : Type w} {n : ℕ} {ι : Type u_1} {f : ι → Z → ℝ}
  [inst : Nonempty ι] {X : Ω → Z} {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))| ≤
      ((↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k).1)|) +
        (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k).2)|) :
  0 ≤ (↑(Fintype.card (Signs n)))⁻¹ := sorry

Tactic state before:
Ω : Type u
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
inst✝ : Nonempty ι
X : Ω → Z
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))| ≤
    ((↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k).1)|) +
      (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k).2)|

Tactic:
rw [← mul_add]
    apply mul_le_mul_of_nonneg_left
    .
  rw [← Finset.sum_add_distrib]
  to_theorem
    apply Finset.sum_le_sum intro σ _ calc
      _ ≤ ⨆ i, |∑ k : Fin n, (σ k : ℝ) * f i (X (ω k).1)| + |∑ k : Fin n, (σ k : ℝ) * f i (X (ω k).2)| :=
        by
        to_theorem
          apply ciSup_mono·
            refine BddAbove.range_add ?B.hf ?B.hg
            rw [bddAbove_def]
            use n * b
            intro y hy
            simp only [Int.reduceNeg, Set.mem_range] at hy
            obtain ⟨y_1, hy'⟩ := hy
            rw [<- hy']
            · apply extracted_1_aux hf'
            · rw [bddAbove_def]
              use n * b
              intro y hy
              simp only [Int.reduceNeg, Set.mem_range] at hy
              obtain ⟨i, hi⟩ := hy
              rw [← hi]
              apply extracted_1_aux hf' intro i
        convert abs_sub _ _
        to_theorem rw [← Finset.sum_sub_distrib]congr ext k
        exact mul_sub_left_distrib ((σ k : ℝ)) (f i (X (ω k).1)) (f i (X (ω k).2))
      _ ≤ _ := by to_theorem apply ciSup_add_le_add_ciSup· apply extracted_1_aux' hf'· apply extracted_1_aux' hf'

Tactic state after:
[case a0
 Ω : Type u
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 inst✝ : Nonempty ι
 X : Ω → Z
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : Fin n → Ω × Ω
 ⊢ 0 ≤ (↑(Fintype.card (Signs n)))⁻¹]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_3.{u_1, w, u} {Ω : Type u} {Z : Type w} {n : ℕ} {ι : Type u_1} {f : ι → Z → ℝ}
  [inst : Nonempty ι] {X : Ω → Z} {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (ω : Fin n → Ω × Ω) :
  ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))| ≤
    ∑ x, ((⨆ i, |∑ k, ↑↑(x k) * f i (X (ω k).1)|) + ⨆ i, |∑ k, ↑↑(x k) * f i (X (ω k).2)|) := sorry

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

Tactic:
apply Finset.sum_le_sum
    intro σ _
    calc
  _ ≤ ⨆ i, |∑ k : Fin n, (σ k : ℝ) * f i (X (ω k).1)| + |∑ k : Fin n, (σ k : ℝ) * f i (X (ω k).2)| :=
    by
    to_theorem
      apply ciSup_mono·
        refine BddAbove.range_add ?B.hf ?B.hg
        rw [bddAbove_def]
        use n * b
        intro y hy
        simp only [Int.reduceNeg, Set.mem_range] at hy
        obtain ⟨y_1, hy'⟩ := hy
        rw [<- hy']
        · apply extracted_1_aux hf'
        · rw [bddAbove_def]
          use n * b
          intro y hy
          simp only [Int.reduceNeg, Set.mem_range] at hy
          obtain ⟨i, hi⟩ := hy
          rw [← hi]
          apply extracted_1_aux hf' intro i
    convert abs_sub _ _
    to_theorem rw [← Finset.sum_sub_distrib]congr ext k
    exact mul_sub_left_distrib ((σ k : ℝ)) (f i (X (ω k).1)) (f i (X (ω k).2))
  _ ≤ _ := by to_theorem apply ciSup_add_le_add_ciSup· apply extracted_1_aux' hf'· apply extracted_1_aux' hf'

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_4.{u_1, w, u} {Ω : Type u} {Z : Type w} {n : ℕ} {ι : Type u_1} {f : ι → Z → ℝ}
  [inst : Nonempty ι] {X : Ω → Z} {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (ω : Fin n → Ω × Ω) (σ : Signs n)
  (a : σ ∈ Finset.univ) :
  ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k).1)| + |∑ k, ↑↑(σ k) * f i (X (ω k).2)| ≤
    (⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k).1)|) + ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k).2)| := sorry

Tactic state before:
Ω : Type u
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
inst✝ : Nonempty ι
X : Ω → Z
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω × Ω
σ : Signs n
a✝ : σ ∈ Finset.univ
⊢ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k).1)| + |∑ k, ↑↑(σ k) * f i (X (ω k).2)| ≤
    (⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k).1)|) + ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k).2)|

Tactic:
apply ciSup_add_le_add_ciSup
    · apply extracted_1_aux' hf'
    · apply extracted_1_aux' hf'

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_5.{u_3, u_2} {α : Type u_2} [inst : MeasurableSpace α] (μ : Measure α)
  [inst_1 : IsFiniteMeasure μ] {ι : Sort u_3} [inst_2 : Countable ι] (f : ι → α → ℝ≥0∞)
  (hfm : ∀ (i : ι), Measurable (f i)) {b : ℝ≥0∞} (hb : b ≠ ⊤) (hf : ∀ (i : ι) (x : α), f i x ≤ b)
  (hf_le : ∀ (i : ι) (x : α), f i x < ⊤) (hfle : ∀ (i : ι), ∀ᵐ (x : α) ∂μ, f i x < ⊤)
  (hfne : ∀ᵐ (x : α) ∂μ, ∀ (i : ι), f i x ≠ ⊤) (hb' : b * μ Set.univ < ⊤) (hf_nebot : ⨆ i, ∫⁻ (a : α), f i a ∂μ ≠ ⊤)
  (hf' : ∫⁻ (a : α), ⨆ i, f i a ∂μ ≠ ⊤) (i : ι) : ∫⁻ (a : α), f i a ∂μ ≤ ∫⁻ (a : α), ⨆ i, f i a ∂μ := sorry

Tactic state before:
α : Type u_2
inst✝² : MeasurableSpace α
μ : Measure α
inst✝¹ : IsFiniteMeasure μ
ι : Sort u_3
inst✝ : Countable ι
f : ι → α → ℝ≥0∞
hfm : ∀ (i : ι), Measurable (f i)
b : ℝ≥0∞
hb : b ≠ ⊤
hf : ∀ (i : ι) (x : α), f i x ≤ b
hf_le : ∀ (i : ι) (x : α), f i x < ⊤
hfle : ∀ (i : ι), ∀ᵐ (x : α) ∂μ, f i x < ⊤
hfne : ∀ᵐ (x : α) ∂μ, ∀ (i : ι), f i x ≠ ⊤
hb' : b * μ Set.univ < ⊤
hf_nebot : ⨆ i, ∫⁻ (a : α), f i a ∂μ ≠ ⊤
hf' : ∫⁻ (a : α), ⨆ i, f i a ∂μ ≠ ⊤
i : ι
⊢ ∫⁻ (a : α), f i a ∂μ ≤ ∫⁻ (a : α), ⨆ i, f i a ∂μ

Tactic:
apply lintegral_mono
    intro x
    exact le_iSup_iff.mpr fun b hb ↦ hb i

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_6.{u_3, u_2} {α : Type u_2} [inst : MeasurableSpace α] (μ : Measure α)
  [inst_1 : IsFiniteMeasure μ] {ι : Sort u_3} [inst_2 : Countable ι] (f : ι → α → ℝ≥0∞)
  (hfm : ∀ (i : ι), Measurable (f i)) {b : ℝ≥0∞} (hb : b ≠ ⊤) (hf : ∀ (i : ι) (x : α), f i x ≤ b)
  (hf_le : ∀ (i : ι) (x : α), f i x < ⊤) (hfle : ∀ (i : ι), ∀ᵐ (x : α) ∂μ, f i x < ⊤)
  (hfne : ∀ᵐ (x : α) ∂μ, ∀ (i : ι), f i x ≠ ⊤) (hb' : b * μ Set.univ < ⊤) (hf_nebot : ⨆ i, ∫⁻ (a : α), f i a ∂μ ≠ ⊤)
  (hf' : ∫⁻ (a : α), ⨆ i, f i a ∂μ ≠ ⊤) (hf'' : ∀ (i : ι), ∫⁻ (a : α), f i a ∂μ ≠ ⊤)
  (hfle' : ∀ᵐ (x : α) ∂μ, ⨆ i, f i x < ⊤)
  (h_original_goal : ⨆ i, (∫⁻ (a : α), f i a ∂μ).toReal ≤ ∫ (a : α), ⨆ i, (f i a).toReal ∂μ) :
  (⨆ i, ∫⁻ (a : α), f i a ∂μ).toReal ≤ ∫ (ω : α), (⨆ i, f i ω).toReal ∂μ := sorry

Tactic state before:
α : Type u_2
inst✝² : MeasurableSpace α
μ : Measure α
inst✝¹ : IsFiniteMeasure μ
ι : Sort u_3
inst✝ : Countable ι
f : ι → α → ℝ≥0∞
hfm : ∀ (i : ι), Measurable (f i)
b : ℝ≥0∞
hb : b ≠ ⊤
hf : ∀ (i : ι) (x : α), f i x ≤ b
hf_le : ∀ (i : ι) (x : α), f i x < ⊤
hfle : ∀ (i : ι), ∀ᵐ (x : α) ∂μ, f i x < ⊤
hfne : ∀ᵐ (x : α) ∂μ, ∀ (i : ι), f i x ≠ ⊤
hb' : b * μ Set.univ < ⊤
hf_nebot : ⨆ i, ∫⁻ (a : α), f i a ∂μ ≠ ⊤
hf' : ∫⁻ (a : α), ⨆ i, f i a ∂μ ≠ ⊤
hf'' : ∀ (i : ι), ∫⁻ (a : α), f i a ∂μ ≠ ⊤
hfle' : ∀ᵐ (x : α) ∂μ, ⨆ i, f i x < ⊤
⊢ ⨆ i, (∫⁻ (a : α), f i a ∂μ).toReal ≤ ∫ (a : α), ⨆ i, (f i a).toReal ∂μ

Tactic:
rw [← ENNReal.toReal_iSup hf'']
    have : ∫ (a : α), ⨆ i, (f i a).toReal ∂μ = ∫ (ω : α), (⨆ i, f i ω).toReal ∂μ :=
  by
  apply MeasureTheory.integral_congr_ae
  filter_upwards [hfne] with ω hω using (ENNReal.toReal_iSup hω).symm
    rw [this]

Tactic state after:
[α : Type u_2
 inst✝² : MeasurableSpace α
 μ : Measure α
 inst✝¹ : IsFiniteMeasure μ
 ι : Sort u_3
 inst✝ : Countable ι
 f : ι → α → ℝ≥0∞
 hfm : ∀ (i : ι), Measurable (f i)
 b : ℝ≥0∞
 hb : b ≠ ⊤
 hf : ∀ (i : ι) (x : α), f i x ≤ b
 hf_le : ∀ (i : ι) (x : α), f i x < ⊤
 hfle : ∀ (i : ι), ∀ᵐ (x : α) ∂μ, f i x < ⊤
 hfne : ∀ᵐ (x : α) ∂μ, ∀ (i : ι), f i x ≠ ⊤
 hb' : b * μ Set.univ < ⊤
 hf_nebot : ⨆ i, ∫⁻ (a : α), f i a ∂μ ≠ ⊤
 hf' : ∫⁻ (a : α), ⨆ i, f i a ∂μ ≠ ⊤
 hf'' : ∀ (i : ι), ∫⁻ (a : α), f i a ∂μ ≠ ⊤
 hfle' : ∀ᵐ (x : α) ∂μ, ⨆ i, f i x < ⊤
 this : ∫ (a : α), ⨆ i, (f i a).toReal ∂μ = ∫ (ω : α), (⨆ i, f i ω).toReal ∂μ
 ⊢ (⨆ i, ∫⁻ (a : α), f i a ∂μ).toReal ≤ ∫ (ω : α), (⨆ i, f i ω).toReal ∂μ]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_7.{u_3, u_2} {α : Type u_2} [inst : MeasurableSpace α] (μ : Measure α)
  [inst_1 : IsFiniteMeasure μ] {ι : Sort u_3} [inst_2 : Countable ι] (f : ι → α → ℝ≥0∞)
  (hfm : ∀ (i : ι), Measurable (f i)) {b : ℝ≥0∞} (hb : b ≠ ⊤) (hf : ∀ (i : ι) (x : α), f i x ≤ b)
  (hf_le : ∀ (i : ι) (x : α), f i x < ⊤) (hfle : ∀ (i : ι), ∀ᵐ (x : α) ∂μ, f i x < ⊤)
  (hfne : ∀ᵐ (x : α) ∂μ, ∀ (i : ι), f i x ≠ ⊤) (hb' : b * μ Set.univ < ⊤) (hf_nebot : ⨆ i, ∫⁻ (a : α), f i a ∂μ ≠ ⊤)
  (hf' : ∫⁻ (a : α), ⨆ i, f i a ∂μ ≠ ⊤) (hf'' : ∀ (i : ι), ∫⁻ (a : α), f i a ∂μ ≠ ⊤)
  (hfle' : ∀ᵐ (x : α) ∂μ, ⨆ i, f i x < ⊤)
  (this : ∫ (a : α), ⨆ i, (f i a).toReal ∂μ = ∫ (ω : α), (⨆ i, f i ω).toReal ∂μ) :
  (⨆ i, ∫⁻ (a : α), f i a ∂μ).toReal ≤ ∫ (ω : α), (⨆ i, f i ω).toReal ∂μ := sorry

Tactic state before:
α : Type u_2
inst✝² : MeasurableSpace α
μ : Measure α
inst✝¹ : IsFiniteMeasure μ
ι : Sort u_3
inst✝ : Countable ι
f : ι → α → ℝ≥0∞
hfm : ∀ (i : ι), Measurable (f i)
b : ℝ≥0∞
hb : b ≠ ⊤
hf : ∀ (i : ι) (x : α), f i x ≤ b
hf_le : ∀ (i : ι) (x : α), f i x < ⊤
hfle : ∀ (i : ι), ∀ᵐ (x : α) ∂μ, f i x < ⊤
hfne : ∀ᵐ (x : α) ∂μ, ∀ (i : ι), f i x ≠ ⊤
hb' : b * μ Set.univ < ⊤
hf_nebot : ⨆ i, ∫⁻ (a : α), f i a ∂μ ≠ ⊤
hf' : ∫⁻ (a : α), ⨆ i, f i a ∂μ ≠ ⊤
hf'' : ∀ (i : ι), ∫⁻ (a : α), f i a ∂μ ≠ ⊤
hfle' : ∀ᵐ (x : α) ∂μ, ⨆ i, f i x < ⊤
this : ∫ (a : α), ⨆ i, (f i a).toReal ∂μ = ∫ (ω : α), (⨆ i, f i ω).toReal ∂μ
⊢ (⨆ i, ∫⁻ (a : α), f i a ∂μ).toReal ≤ ∫ (ω : α), (⨆ i, f i ω).toReal ∂μ

Tactic:
rw [MeasureTheory.integral_toReal (Measurable.iSup hfm).aemeasurable hfle']
    rw [ENNReal.toReal_le_toReal hf_nebot hf']
    apply iSup_lintegral_le

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_8.{u_3, u_2} {α : Type u_2} [inst : MeasurableSpace α] (μ : Measure α)
  [inst_1 : IsFiniteMeasure μ] {ι : Sort u_3} [inst_2 : Countable ι] (f : ι → α → ℝ)
  (hf : ∀ (i : ι), Measurable fun a => f i a) {b : ℝ} (hf' : ∀ (i : ι) (x : α), |f i x| ≤ b) :
  ⨆ i, ∫ (ω : α), (ENNReal.ofReal |f i ω|).toReal ∂μ ≤ ∫ (ω : α), ⨆ i, (ENNReal.ofReal |f i ω|).toReal ∂μ := sorry

Tactic state before:
α : Type u_2
inst✝² : MeasurableSpace α
μ : Measure α
inst✝¹ : IsFiniteMeasure μ
ι : Sort u_3
inst✝ : Countable ι
f : ι → α → ℝ
hf : ∀ (i : ι), Measurable fun a => f i a
b : ℝ
hf' : ∀ (i : ι) (x : α), |f i x| ≤ b
⊢ ⨆ i, ∫ (ω : α), (ENNReal.ofReal |f i ω|).toReal ∂μ ≤ ∫ (ω : α), ⨆ i, (ENNReal.ofReal |f i ω|).toReal ∂μ

Tactic:
apply
  iSup_integral_le_aux μ (fun i a ↦ .ofReal |f i a|) (fun i ↦ (hf i).norm.ennreal_ofReal)
    (ENNReal.ofReal_ne_top : .ofReal (b + 1) ≠ ⊤) (fun i x ↦ ENNReal.ofReal_le_ofReal (le_of_lt ?_))
    have hf' := hf' i x
    linarith

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_9.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {X : Ω → Z} (hf : ∀ (i : ι), Measurable (f i ∘ X)) (i : ι) (ω : Fin n → Ω) :
  Measurable fun ω' => ∑ k, (f i (X (ω k)) - f i (X (ω' k))) := sorry

Tactic state before:
Ω : Type u
inst✝ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
i : ι
ω : Fin n → Ω
⊢ Measurable fun ω' => ∑ k, (f i (X (ω k)) - f i (X (ω' k)))

Tactic:
apply Finset.univ.measurable_sum
    intro k _
    apply ((hf i).comp measurable_const).sub ((hf i).comp (measurable_pi_apply k))

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_10.{u_1, w, u} {Ω : Type u} {Z : Type w} {n : ℕ} {ι : Type u_1} {f : ι → Z → ℝ}
  {X : Ω → Z} {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (i : ι) (ω : Fin n → Ω)
  (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 : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
i : ι
ω : Fin n → Ω
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_11.{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 → Ω) (σ : Signs n)
  (a : σ ∈ Finset.univ)
  (h_original_goal : |⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|| ≤ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|) :
  0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))| := sorry

Tactic state before:
case h
Ω : 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 → Ω
σ : Signs n
a✝ : σ ∈ Finset.univ
⊢ |⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|| ≤ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|

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

Tactic state after:
[case pos
 Ω : 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 → Ω
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 h : Nonempty ι
 ⊢ 0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|,
 case neg
 Ω : 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 → Ω
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 h : ¬Nonempty ι
 ⊢ 0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_12.{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 → Ω) (σ : Signs n)
  (a : σ ∈ Finset.univ)
  (h_original_goal : |⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|| ≤ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|) :
  0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))| := sorry

Tactic state before:
case h
Ω : 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 → Ω
σ : Signs n
a✝ : σ ∈ Finset.univ
⊢ |⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|| ≤ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|

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

Tactic state after:
[case pos
 Ω : 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 → Ω
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 h : Nonempty ι
 ⊢ 0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|,
 case neg
 Ω : 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 → Ω
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 h : ¬Nonempty ι
 ⊢ 0 ≤ ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_13.{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_original_goal : ∑ σ, ⨆ i, ∑ k, |f i (X (ω k))| ≤ 2 ^ n * (↑n * b)) : ⨆ i, ∑ 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 → Ω
⊢ ∑ σ, ⨆ i, ∑ k, |f i (X (ω k))| ≤ 2 ^ n * (↑n * 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))| ≤ ∑ k : Fin n, b from by
    to_theorem
      apply
        le_trans this _ apply le_of_eq simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]
  exact Finset.sum_le_sum fun k _ ↦ hf' i (X (ω k))

Tactic state after:
[case neg
 Ω : 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, ∑ k, |f i (X (ω k))| ≤ ↑n * b]