zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_0 (x : ℝ) (hx : |x| ≤ 1) (hx_le_1 : x ≤ 1) (u : ℝ) (hu : u ∈ interior (Ici 0))
  (h_original_goal : rexp (u * x) * x * x - x ^ 2 * rexp u ≤ 0) : 0 < u := sorry

Tactic state before:
case a
x τ : ℝ
hx : |x| ≤ 1
hτ : 0 ≤ τ
hx_le_1 : x ≤ 1
f : ℝ → ℝ := fun τ => rexp (τ * x) - (1 + τ * x + x ^ 2 * (rexp τ - 1 - τ))
f' : ℝ → ℝ := fun τ => rexp (τ * x) * x - (x + x ^ 2 * (rexp τ - 1))
f'' : ℝ → ℝ := fun τ => rexp (τ * x) * x * x - x ^ 2 * rexp τ
hf0 : f 0 = 0
hf'0 : f' 0 = 0
t : ℝ
ht : t ∈ interior (Ici 0)
u : ℝ
hu : u ∈ interior (Ici 0)
⊢ rexp (u * x) * x * x - x ^ 2 * rexp u ≤ 0

Tactic:
apply sub_nonpos_of_le
    rw [mul_assoc, ← sq, mul_comm (rexp _)]
    refine mul_le_mul_of_nonneg_left ?_ (sq_nonneg x)
    apply exp_monotone
    refine (mul_le_iff_le_one_right ?_).mpr hx_le_1

Tactic state after:
[case a.a.a
 x τ : ℝ
 hx : |x| ≤ 1
 hτ : 0 ≤ τ
 hx_le_1 : x ≤ 1
 f : ℝ → ℝ := fun τ => rexp (τ * x) - (1 + τ * x + x ^ 2 * (rexp τ - 1 - τ))
 f' : ℝ → ℝ := fun τ => rexp (τ * x) * x - (x + x ^ 2 * (rexp τ - 1))
 f'' : ℝ → ℝ := fun τ => rexp (τ * x) * x * x - x ^ 2 * rexp τ
 hf0 : f 0 = 0
 hf'0 : f' 0 = 0
 t : ℝ
 ht : t ∈ interior (Ici 0)
 u : ℝ
 hu : u ∈ interior (Ici 0)
 ⊢ 0 < u]
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_1.{u} {Ω : Type u} [inst : MeasurableSpace Ω] (μ : Measure Ω)
  [inst_1 : IsProbabilityMeasure μ] {n : ℕ} {X : Fin n → Ω → ℝ} (hXm : ∀ (i : Fin n), Measurable (X i))
  (hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1) (τ : ℝ) (hlam : τ ≥ 0) :
  let S := fun ω => ∑ i, X i ω;
  Measurable S →
    (Measurable fun ω => rexp (τ * S ω)) →
      (∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, ‖rexp (τ * X i ω)‖ ≤ rexp τ) →
        (∀ᵐ (ω : Ω) ∂μ, ∀ (i : Fin n), |X i ω| ≤ 1) →
          ∀ (ω : Ω), (∀ (i : Fin n), |X i ω| ≤ 1) → ‖rexp (τ * S ω)‖ ≤ rexp (↑n * τ) := sorry

Tactic state before:
case h
Ω : Type u
inst : MeasurableSpace Ω
μ : Measure Ω
inst_1 : IsProbabilityMeasure μ
n : ℕ
X : Fin n → Ω → ℝ
hXm : ∀ (i : Fin n), Measurable (X i)
hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1
τ : ℝ
hlam : τ ≥ 0
S : Ω → ℝ := fun ω => ∑ i, X i ω
hS_meas : Measurable S
f : ℝ → ℝ := fun x => rexp (τ * x)
f_meas : Measurable f
f_measω : Measurable fun ω => rexp (τ * S ω)
h_bound : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, ‖rexp (τ * X i ω)‖ ≤ rexp τ
h_all : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : Fin n), |X i ω| ≤ 1
ω : Ω
hω : ∀ (i : Fin n), |X i ω| ≤ 1
⊢ ‖rexp (τ * S ω)‖ ≤ rexp (↑n * τ)

Tactic:
rw [norm_eq_abs, abs_of_nonneg (exp_pos _).le]
    rw [exp_le_exp]
    suffices S ω ≤ n by nlinarith
    unfold S
    calc
  ∑ i, X i ω ≤ ∑ i, |X i ω| := by gcongr; exact le_abs_self (X _ ω)
  _ ≤ ∑ i, 1 := by gcongr; exact hω _
  _ = n := by simp [Finset.sum_const, nsmul_eq_mul, mul_one]

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, i ∈ s → x i ∈ if h : i ∈ s then f' i h else Set.univ := 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
    rw [← (hf' i h).2] at this
    exact this

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_0.{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 ∂μ ≤ ∫⁻ (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 ∂μ ≠ ⊤
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]
    rw [MeasureTheory.integral_toReal (Measurable.iSup hfm).aemeasurable hfle']
    rw [ENNReal.toReal_le_toReal hf_nebot hf']

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 ∂μ ≤ ∫⁻ (a : α), ⨆ i, f i a ∂μ]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_1.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z}
  (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (i : ι) (k : Fin n) :
  Integrable (fun ω => f i (X (ω k))) (Measure.pi fun x => μ) := sorry

Tactic state before:
Ω : Type u
inst✝¹ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
i : ι
k : Fin n
⊢ Integrable (fun ω => f i (X (ω k))) (Measure.pi fun x => μ)

Tactic:
rw [← memLp_one_iff_integrable]
    apply MemLp.of_bound (measurable_aux0 hf i k).aestronglyMeasurable b
    filter_upwards with ω
    simp only [norm_eq_abs]
    exact hf' i (X (ω k))

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 → ℝ}
  {X : Ω → Z} {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (ω : Fin n → Ω) :
  ∑ σ, ⨆ i, |(|∑ k, ↑↑(σ k) * f i (X (ω k))|)| ≤ ∑ σ, ⨆ i, ∑ k, |↑↑(σ k) * f i (X (ω k))| := 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, ↑↑(σ k) * f i (X (ω k))|)| ≤ ∑ σ, ⨆ i, ∑ k, |↑↑(σ k) * f i (X (ω k))|

Tactic:
apply Finset.sum_le_sum
    intro σ _
    apply ciSup_mono
    · apply bdd_above_aux hf'
    ·
  intro i
  simp only [Int.reduceNeg, abs_abs]
  apply Finset.abs_sum_le_sum_abs

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_3.{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 : ι) : 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.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)))

Tactic:
apply Finset.measurable_sum Finset.univ
    intro i' hi
    apply Measurable.sub
    apply (hf i).comp measurable_snd.eval
    apply (hf i).comp measurable_fst.eval

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 : 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) (y : ℝ)
  (hy : y ∈ Set.range fun i => |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|) : y ≤ z := 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 : ∃ 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
y : ℝ
hy : y ∈ Set.range fun i => |∑ k, ↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))|
⊢ y ≤ z

Tactic:
simp only [Int.reduceNeg, Set.mem_range] at hy
    have ⟨i, hi⟩ := hy
    rw [← hi]
    simp only [Int.reduceNeg, ge_iff_le]
    calc
  _ ≤ ∑ k : Fin n, |↑↑(σ k) * (f i (X (ω k).1) - f i (X (ω k).2))| := by apply Finset.abs_sum_le_sum_abs
  _ ≤ z := by
    apply hz
    simp

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_5.{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 : ι) : Measurable fun b => |∑ k, ↑↑(σ k) * f i (X (b k).1)| := sorry

Tactic state before:
case 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 : ι
⊢ Measurable fun b => |∑ k, ↑↑(σ k) * f i (X (b k).1)|

Tactic:
apply Measurable.abs
    apply Finset.univ.measurable_sum
    intro k _
    apply measurable_const.mul
    apply (hf i).comp (measurable_pi_apply k).fst

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_6.{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 : ι) : Measurable fun b => |∑ k, ↑↑(σ k) * f i (X (b k).2)| := sorry

Tactic state before:
case 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 : ι
⊢ Measurable fun b => |∑ k, ↑↑(σ k) * f i (X (b k).2)|

Tactic:
apply Measurable.abs
    apply Finset.univ.measurable_sum
    intro k _
    apply measurable_const.mul
    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_8.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z} [inst_2 : Nonempty ι]
  [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b)
  (ω' : Fin n → Ω) (i : ι)
  (h_original_goal :
    (∫ (x : Fin n → Ω), ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (x x_1)) ∂Measure.pi fun x => μ) ≤
      ∫ (x : Fin n → Ω), ↑n * (b + b) ∂Measure.pi fun x => μ) :
  Integrable (fun a => ∑ x_1, f i (X (a x_1))) (Measure.pi fun x => μ) := sorry

Tactic state before:
Ω : Type u
inst✝¹ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
X : Ω → Z
inst_2 : Nonempty ι
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω' : Fin n → Ω
i : ι
⊢ (∫ (x : Fin n → Ω), ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (x x_1)) ∂Measure.pi fun x => μ) ≤
    ∫ (x : Fin n → Ω), ↑n * (b + b) ∂Measure.pi fun x => μ

Tactic:
apply integral_mono
    apply Integrable.sub
    constructor
    exact aestronglyMeasurable_const
    exact hasFiniteIntegral_const (∑ x : Fin n, f i (X (ω' x)))

Tactic state after:
[case hf.hg
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω' : Fin n → Ω
 i : ι
 ⊢ Integrable (fun a => ∑ x_1, f i (X (a x_1))) (Measure.pi fun x => μ),
 case hg
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω' : Fin n → Ω
 i : ι
 ⊢ Integrable (fun a => ↑n * (b + b)) (Measure.pi fun x => μ),
 case h
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω' : Fin n → Ω
 i : ι
 ⊢ (fun a => ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (a x_1))) ≤ fun a => ↑n * (b + b)]
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 → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z} [inst_2 : Nonempty ι]
  [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b)
  (ω' : Fin n → Ω) (i : ι)
  (h_original_goal :
    (∫ (x : Fin n → Ω), ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (x x_1)) ∂Measure.pi fun x => μ) ≤
      ∫ (x : Fin n → Ω), ↑n * (b + b) ∂Measure.pi fun x => μ) :
  Integrable (fun a => ↑n * (b + b)) (Measure.pi fun x => μ) := sorry

Tactic state before:
Ω : Type u
inst✝¹ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
X : Ω → Z
inst_2 : Nonempty ι
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω' : Fin n → Ω
i : ι
⊢ (∫ (x : Fin n → Ω), ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (x x_1)) ∂Measure.pi fun x => μ) ≤
    ∫ (x : Fin n → Ω), ↑n * (b + b) ∂Measure.pi fun x => μ

Tactic:
apply integral_mono
    apply Integrable.sub
    constructor
    exact aestronglyMeasurable_const
    exact hasFiniteIntegral_const (∑ x : Fin n, f i (X (ω' x)))

Tactic state after:
[case hf.hg
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω' : Fin n → Ω
 i : ι
 ⊢ Integrable (fun a => ∑ x_1, f i (X (a x_1))) (Measure.pi fun x => μ),
 case hg
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω' : Fin n → Ω
 i : ι
 ⊢ Integrable (fun a => ↑n * (b + b)) (Measure.pi fun x => μ),
 case h
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω' : Fin n → Ω
 i : ι
 ⊢ (fun a => ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (a x_1))) ≤ fun a => ↑n * (b + b)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_10.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z} [inst_2 : Nonempty ι]
  [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b)
  (ω' : Fin n → Ω) (i : ι)
  (h_original_goal :
    (∫ (x : Fin n → Ω), ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (x x_1)) ∂Measure.pi fun x => μ) ≤
      ∫ (x : Fin n → Ω), ↑n * (b + b) ∂Measure.pi fun x => μ) :
  (fun a => ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (a x_1))) ≤ fun a => ↑n * (b + b) := sorry

Tactic state before:
Ω : Type u
inst✝¹ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
X : Ω → Z
inst_2 : Nonempty ι
inst_3 : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω' : Fin n → Ω
i : ι
⊢ (∫ (x : Fin n → Ω), ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (x x_1)) ∂Measure.pi fun x => μ) ≤
    ∫ (x : Fin n → Ω), ↑n * (b + b) ∂Measure.pi fun x => μ

Tactic:
apply integral_mono
    apply Integrable.sub
    constructor
    exact aestronglyMeasurable_const
    exact hasFiniteIntegral_const (∑ x : Fin n, f i (X (ω' x)))

Tactic state after:
[case hf.hg
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω' : Fin n → Ω
 i : ι
 ⊢ Integrable (fun a => ∑ x_1, f i (X (a x_1))) (Measure.pi fun x => μ),
 case hg
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω' : Fin n → Ω
 i : ι
 ⊢ Integrable (fun a => ↑n * (b + b)) (Measure.pi fun x => μ),
 case h
 Ω : Type u
 inst✝¹ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 X : Ω → Z
 inst_2 : Nonempty ι
 inst_3 : Countable ι
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω' : Fin n → Ω
 i : ι
 ⊢ (fun a => ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (a x_1))) ≤ fun a => ↑n * (b + b)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_13.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] {X : Ω → Z} [inst_2 : Nonempty ι]
  [inst_3 : Countable ι] (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hb : b ≥ 0)
  (hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b) (hn : ¬n = 0)
  (hr : ∃ C, ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), y ≤ C)
  (hr' : ∃ C, ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), C ≤ y)
  (hq : ∀ (ω : Fin n → Ω) (k : Fin n), BddAbove (Set.range fun i => f i (X (ω k))))
  (hq' : ∀ (ω : Fin n → Ω) (k : Fin n), BddBelow (Set.range fun i => f i (X (ω k)))) :
  (∫ (x : Fin n → Ω),
      (fun ω => ⨆ i, |∑ k, f i (X (ω k)) - n • ∫ (x : Ω), (fun ω' => f i (X ω')) x ∂μ|) x ∂Measure.pi fun x => μ) =
    ∫ (x : Fin n → Ω),
      (fun ω => ⨆ i, |∑ k, (f i (X (ω k)) - ∫ (x : Ω), (fun ω' => f i (X ω')) x ∂μ)|) x ∂Measure.pi fun x => μ := sorry

Tactic state before:
Ω : Type u
inst✝³ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
X : Ω → Z
inst✝¹ : Nonempty ι
inst✝ : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : b ≥ 0
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
hn : ¬n = 0
hr : ∃ C, ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), y ≤ C
hr' : ∃ C, ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), C ≤ y
hq : ∀ (ω : Fin n → Ω) (k : Fin n), BddAbove (Set.range fun i => f i (X (ω k)))
hq' : ∀ (ω : Fin n → Ω) (k : Fin n), BddBelow (Set.range fun i => f i (X (ω k)))
⊢ (∫ (x : Fin n → Ω),
      (fun ω => ⨆ i, |∑ k, f i (X (ω k)) - n • ∫ (x : Ω), (fun ω' => f i (X ω')) x ∂μ|) x ∂Measure.pi fun x => μ) =
    ∫ (x : Fin n → Ω),
      (fun ω => ⨆ i, |∑ k, (f i (X (ω k)) - ∫ (x : Ω), (fun ω' => f i (X ω')) x ∂μ)|) x ∂Measure.pi fun x => μ

Tactic:
apply congrArg
    funext ω
    apply congrArg
    funext i
    simp

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory

theorem extracted_formal_statement_0.{u_4, u_3, u_2, u_1} {E : Type u_1} [inst : NormedAddCommGroup E]
  [inst_1 : NormedSpace ℝ E] {Ω : Type u_2} {β : Type u_3} {β' : Type u_4} {_mΩ : MeasurableSpace Ω} {μ : Measure Ω}
  {f : Ω → β} {g : Ω → β'} {F : β × β' → E} {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
  [inst_2 : IsFiniteMeasure μ] {hF' : StronglyMeasurable F} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
  (hfg : IndepFun f g μ) (hF : HasFiniteIntegral F ((Measure.map f μ).prod (Measure.map g μ))) :
  let ν := Measure.map f μ;
  let ν' := Measure.map g μ;
  Measure.map (fun ω => (f ω, g ω)) μ = ν.prod ν' →
    ∫ (ω : Ω), ∫ (x' : β'), F (f ω, x') ∂ν' ∂μ = ∫ (x : β), ∫ (x' : β'), F (x, x') ∂ν' ∂ν := sorry

Tactic state before:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
Ω : Type u_2
β : Type u_3
β' : Type u_4
_mΩ : MeasurableSpace Ω
μ : Measure Ω
f : Ω → β
g : Ω → β'
F : β × β' → E
mβ : MeasurableSpace β
mβ' : MeasurableSpace β'
inst✝ : IsFiniteMeasure μ
hF' : StronglyMeasurable F
hf : AEMeasurable f μ
hg : AEMeasurable g μ
hfg : IndepFun f g μ
hF : HasFiniteIntegral F ((Measure.map f μ).prod (Measure.map g μ))
ν : Measure β := Measure.map f μ
ν' : Measure β' := Measure.map g μ
hfg' : Measure.map (fun ω => (f ω, g ω)) μ = ν.prod ν'
⊢ ∫ (ω : Ω), ∫ (x' : β'), F (f ω, x') ∂ν' ∂μ = ∫ (x : β), ∫ (x' : β'), F (x, x') ∂ν' ∂ν

Tactic:
apply Eq.symm
    apply MeasureTheory.integral_map
    assumption
    apply StronglyMeasurable.aestronglyMeasurable
    exact StronglyMeasurable.integral_prod_right hF'

Tactic state after: