zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_54.{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)
  (h_original_goal :
    AEStronglyMeasurable (fun x => ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (x.2 k))|)
      ((Measure.pi fun x => μ).prod (Measure.pi fun x => μ)))
  (i : Signs n) : i ∈ Finset.univ → Measurable fun x => ⨆ i_1, |∑ k, ↑↑(i k) * f i_1 (X (x.2 k))| := sorry

Tactic state before:
case left.hf
Ω : 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 : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
⊢ AEStronglyMeasurable (fun x => ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (x.2 k))|)
    ((Measure.pi fun x => μ).prod (Measure.pi fun x => μ))

Tactic:
apply AEMeasurable.aestronglyMeasurable
    apply Measurable.aemeasurable
    refine Finset.measurable_sum Finset.univ ?left.hf.hf.h.hf

Tactic state after:
[case left.hf.hf.h.hf
 Ω : 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 : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ⊢ ∀ i ∈ Finset.univ, Measurable fun x => ⨆ i_1, |∑ k, ↑↑(i k) * f i_1 (X (x.2 k))|]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_55.{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)
  (i : Signs n) (hi : i ∈ Finset.univ) (i_1 : ι) (k : Fin n)
  (h_original_goal : Measurable fun b => ↑↑(i k) * f i_1 (X (b.2 k))) : Measurable fun a => a.2 k := 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 : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
i : Signs n
hi : i ∈ Finset.univ
i_1 : ι
k : Fin n
⊢ Measurable fun b => ↑↑(i k) * f i_1 (X (b.2 k))

Tactic:
apply Measurable.mul
    exact measurable_const
    apply (hf i_1).comp

Tactic state after:
[case hg
 Ω : 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 : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 i : Signs n
 hi : i ∈ Finset.univ
 i_1 : ι
 k : Fin n
 ⊢ Measurable fun a => a.2 k]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_56.{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)
  (i : Signs n) (hi : i ∈ Finset.univ) (i_1 : ι) (k : Fin n)
  (h_original_goal : Measurable fun b => ↑↑(i k) * f i_1 (X (b.2 k))) : Measurable fun a => a.2 k := 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 : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
i : Signs n
hi : i ∈ Finset.univ
i_1 : ι
k : Fin n
⊢ Measurable fun b => ↑↑(i k) * f i_1 (X (b.2 k))

Tactic:
apply Measurable.mul
    exact measurable_const
    apply (hf i_1).comp

Tactic state after:
[case hg
 Ω : 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 : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 i : Signs n
 hi : i ∈ Finset.univ
 i_1 : ι
 k : Fin n
 ⊢ Measurable fun a => a.2 k]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_57.{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)
  (a : (Fin n → Ω) × (Fin n → Ω))
  (h_original_goal : ‖(↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (a.2 k))|‖ ≤ ↑n * b) :
  |∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (a.2 k))|| ≤ 2 ^ n * (↑n * b) := sorry

Tactic state before:
case right.h
Ω : 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 : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
a : (Fin n → Ω) × (Fin n → Ω)
⊢ ‖(↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (a.2 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₀]
    have l0 : |(∑ σ : Signs n, (⨆ i, |(∑ k : Fin n, (σ k : ℝ) * f i (X (a.2 k)))|))| ≤ ↑(2 ^ n) * (↑n * b) := by
  calc
    _ ≤ ∑ σ : Signs n, |(⨆ i, |∑ k : Fin n, (σ k : ℝ) * f i (X (a.2 k))|)| := by apply Finset.abs_sum_le_sum_abs
    _ ≤ ∑ σ : Signs n, ↑n * b :=
      by
      to_theorem apply Finset.sum_le_sum intro i hi apply abs_iSup_le
      intro i_1
      to_theorem
        simp only [Int.reduceNeg, abs_abs]have l1 : |∑ k : Fin n, (i k : ℝ) * f i_1 (X (a.2 k))| ≤ ↑n * b := by
          calc
            _ ≤ ∑ k : Fin n, |(i k : ℝ) * f i_1 (X (a.2 k))| := by apply Finset.abs_sum_le_sum_abs
            _ ≤ ∑ k : Fin n, b := by
              apply Finset.sum_le_sum
              intro i_2 hi_2
              rw [abs_mul]
              rw [abs_sigma (i i_2)]
              simp only [one_mul, ge_iff_le]
              exact hf' i_1 (X (a.2 i_2))
            _ ≤ ↑n * b := by simp exact l1
    _ = Fintype.card (Signs n) * (↑n * b) := by simp
    _ = 2 ^ n * (↑n * b) := by simp

Tactic state after:
[case right.h
 Ω : 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 : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 a : (Fin n → Ω) × (Fin n → Ω)
 l0 : |∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (a.2 k))|| ≤ 2 ^ n * (↑n * b)
 ⊢ |∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (a.2 k))|| ≤ 2 ^ n * (↑n * b),
 case right.h
 Ω : 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 : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 a : (Fin n → Ω) × (Fin n → Ω)
 ⊢ 0 < 2 ^ n]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_58.{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)
  (a : (Fin n → Ω) × (Fin n → Ω))
  (h_original_goal : ‖(↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (a.2 k))|‖ ≤ ↑n * b) :
  0 < 2 ^ n := sorry

Tactic state before:
case right.h
Ω : 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 : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
a : (Fin n → Ω) × (Fin n → Ω)
⊢ ‖(↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (a.2 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₀]
    have l0 : |(∑ σ : Signs n, (⨆ i, |(∑ k : Fin n, (σ k : ℝ) * f i (X (a.2 k)))|))| ≤ ↑(2 ^ n) * (↑n * b) := by
  calc
    _ ≤ ∑ σ : Signs n, |(⨆ i, |∑ k : Fin n, (σ k : ℝ) * f i (X (a.2 k))|)| := by apply Finset.abs_sum_le_sum_abs
    _ ≤ ∑ σ : Signs n, ↑n * b :=
      by
      to_theorem apply Finset.sum_le_sum intro i hi apply abs_iSup_le
      intro i_1
      to_theorem
        simp only [Int.reduceNeg, abs_abs]have l1 : |∑ k : Fin n, (i k : ℝ) * f i_1 (X (a.2 k))| ≤ ↑n * b := by
          calc
            _ ≤ ∑ k : Fin n, |(i k : ℝ) * f i_1 (X (a.2 k))| := by apply Finset.abs_sum_le_sum_abs
            _ ≤ ∑ k : Fin n, b := by
              apply Finset.sum_le_sum
              intro i_2 hi_2
              rw [abs_mul]
              rw [abs_sigma (i i_2)]
              simp only [one_mul, ge_iff_le]
              exact hf' i_1 (X (a.2 i_2))
            _ ≤ ↑n * b := by simp exact l1
    _ = Fintype.card (Signs n) * (↑n * b) := by simp
    _ = 2 ^ n * (↑n * b) := by simp

Tactic state after:
[case right.h
 Ω : 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 : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 a : (Fin n → Ω) × (Fin n → Ω)
 l0 : |∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (a.2 k))|| ≤ 2 ^ n * (↑n * b)
 ⊢ |∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (a.2 k))|| ≤ 2 ^ n * (↑n * b),
 case right.h
 Ω : 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 : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 a : (Fin n → Ω) × (Fin n → Ω)
 ⊢ 0 < 2 ^ n]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_59.{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)
  (a : (Fin n → Ω) × (Fin n → Ω)) (i : Signs n) (hi : i ∈ Finset.univ) (i_1 : ι) :
  |(|∑ k, ↑↑(i k) * f i_1 (X (a.2 k))|)| ≤ ↑n * b := sorry

Tactic state before:
case h.hf
Ω : 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 : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
a : (Fin n → Ω) × (Fin n → Ω)
i : Signs n
hi : i ∈ Finset.univ
i_1 : ι
⊢ |(|∑ k, ↑↑(i k) * f i_1 (X (a.2 k))|)| ≤ ↑n * b

Tactic:
simp only [Int.reduceNeg, abs_abs]
    have l1 : |∑ k : Fin n, (i k : ℝ) * f i_1 (X (a.2 k))| ≤ ↑n * b := by
  calc
    _ ≤ ∑ k : Fin n, |(i k : ℝ) * f i_1 (X (a.2 k))| := by apply Finset.abs_sum_le_sum_abs
    _ ≤ ∑ k : Fin n, b := by
      apply Finset.sum_le_sum
      intro i_2 hi_2
      rw [abs_mul]
      rw [abs_sigma (i i_2)]
      simp only [one_mul, ge_iff_le]
      exact hf' i_1 (X (a.2 i_2))
    _ ≤ ↑n * b := by simp
    exact l1

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_64.{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)
  (hp : ∀ (i : ι) (j : Fin n), Integrable (fun a => f i (X (a j))) (Measure.pi fun x => μ))
  (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))))
  (hq0 : ∀ (ω x : Fin n → Ω) (k : Fin n), BddAbove (Set.range fun i => f i (X (ω k)) - f i (X (x k))))
  (hq1_1 : ∀ (ω x : Fin n → Ω), BddAbove (Set.range fun i => ∑ k, (f i (X (ω k)) - f i (X (x k)))))
  (hq2 : ∀ (ω x : Fin n → Ω) (k : Fin n), BddBelow (Set.range fun i => f i (X (ω k)) - f i (X (x k))))
  (hq3 : ∀ (ω x : Fin n → Ω), BddBelow (Set.range fun i => ∑ k, (f i (X (ω k)) - f i (X (x k)))))
  (hq1 : ∀ (ω x : Fin n → Ω), BddAbove (Set.range fun i => |∑ k, (f i (X (ω k)) - f i (X (x k)))|)) (C : ℝ)
  (hr0 : ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), y ≤ C) (D : ℝ)
  (hr1 : ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), D ≤ y) (a : ι) (x : Fin n → Ω)
  (k : Fin n) : f a (X (x k)) ≤ C := sorry

Tactic state before:
case hbu
Ω : 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 : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω
hp : ∀ (i : ι) (j : Fin n), Integrable (fun a => f i (X (a j))) (Measure.pi fun x => μ)
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)))
hq0 : ∀ (ω x : Fin n → Ω) (k : Fin n), BddAbove (Set.range fun i => f i (X (ω k)) - f i (X (x k)))
hq1✝ : ∀ (ω x : Fin n → Ω), BddAbove (Set.range fun i => ∑ k, (f i (X (ω k)) - f i (X (x k))))
hq2 : ∀ (ω x : Fin n → Ω) (k : Fin n), BddBelow (Set.range fun i => f i (X (ω k)) - f i (X (x k)))
hq3 : ∀ (ω x : Fin n → Ω), BddBelow (Set.range fun i => ∑ k, (f i (X (ω k)) - f i (X (x k))))
hq1 : ∀ (ω x : Fin n → Ω), BddAbove (Set.range fun i => |∑ k, (f i (X (ω k)) - f i (X (x k)))|)
C : ℝ
hr0 : ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), y ≤ C
D : ℝ
hr1 : ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), D ≤ y
a : ι
x : Fin n → Ω
k : Fin n
⊢ f a (X (x k)) ≤ C

Tactic:
apply hr0
    simp only [Set.mem_range]
    use a

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_67.{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)
  (hp : ∀ (i : ι) (j : Fin n), Integrable (fun a => f i (X (a j))) (Measure.pi fun x => μ))
  (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))))
  (hq0 : ∀ (ω x : Fin n → Ω) (k : Fin n), BddAbove (Set.range fun i => f i (X (ω k)) - f i (X (x k))))
  (hq1_1 : ∀ (ω x : Fin n → Ω), BddAbove (Set.range fun i => ∑ k, (f i (X (ω k)) - f i (X (x k)))))
  (hq2 : ∀ (ω x : Fin n → Ω) (k : Fin n), BddBelow (Set.range fun i => f i (X (ω k)) - f i (X (x k))))
  (hq3 : ∀ (ω x : Fin n → Ω), BddBelow (Set.range fun i => ∑ k, (f i (X (ω k)) - f i (X (x k)))))
  (hq1 : ∀ (ω x : Fin n → Ω), BddAbove (Set.range fun i => |∑ k, (f i (X (ω k)) - f i (X (x k)))|)) (C : ℝ)
  (hr0 : ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), y ≤ C) (D : ℝ)
  (hr1 : ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), D ≤ y) (y : ℝ)
  (hy : y ∈ Set.range fun a => ↑n * (C - D)) : y ≤ ↑n * (C - D) + 1 := sorry

Tactic state before:
case h
Ω : 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 : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
ω : Fin n → Ω
hp : ∀ (i : ι) (j : Fin n), Integrable (fun a => f i (X (a j))) (Measure.pi fun x => μ)
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)))
hq0 : ∀ (ω x : Fin n → Ω) (k : Fin n), BddAbove (Set.range fun i => f i (X (ω k)) - f i (X (x k)))
hq1✝ : ∀ (ω x : Fin n → Ω), BddAbove (Set.range fun i => ∑ k, (f i (X (ω k)) - f i (X (x k))))
hq2 : ∀ (ω x : Fin n → Ω) (k : Fin n), BddBelow (Set.range fun i => f i (X (ω k)) - f i (X (x k)))
hq3 : ∀ (ω x : Fin n → Ω), BddBelow (Set.range fun i => ∑ k, (f i (X (ω k)) - f i (X (x k))))
hq1 : ∀ (ω x : Fin n → Ω), BddAbove (Set.range fun i => |∑ k, (f i (X (ω k)) - f i (X (x k)))|)
C : ℝ
hr0 : ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), y ≤ C
D : ℝ
hr1 : ∀ (ω : Fin n → Ω) (k : Fin n), ∀ y ∈ Set.range fun i => f i (X (ω k)), D ≤ y
y : ℝ
hy : y ∈ Set.range fun a => ↑n * (C - D)
⊢ y ≤ ↑n * (C - D) + 1

Tactic:
simp only [Set.range_const, Set.mem_singleton_iff] at hy
    rw [hy]
    linarith

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_68.{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)) (x : Fin n → Ω) (i : ι) (k : Fin n) :
  f i (X (x k)) - ∫ (x : Ω), f i (X x) ∂μ =
    f i (X (x k)) - ∫ (x : Fin n → Ω), f i (X (x k)) ∂Measure.pi fun x => μ := sorry

Tactic state before:
case e_f.h.e_s.h.e_a.e_f.h
Ω : 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)
x✝ : Fin n → Ω
i : ι
k : Fin n
⊢ f i (X (x✝ k)) - ∫ (x : Ω), f i (X x) ∂μ = f i (X (x✝ k)) - ∫ (x : Fin n → Ω), f i (X (x k)) ∂Measure.pi fun x => μ

Tactic:
apply congrArg
    have : (Measure.map (fun f ↦ f k) (μⁿ))[fun y ↦ f i (X y)] = μⁿ[fun x : Fin n → Ω ↦ f i (X (x k))] :=
  integral_map (measurable_pi_apply k).aemeasurable (Measurable.aestronglyMeasurable (hf i))
    rw [← this, pi_map_eval k]

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_69.{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)))) (ω : Fin n → Ω) (i : ι) :
  |∑ k, (f i (X (ω k)) - ∫ (x : Fin n → Ω), (fun ω' => f i (X (ω' k))) x ∂Measure.pi fun x => μ)| =
    |∫ (x : Fin n → Ω), (fun ω' => ∑ k, (f i (X (ω k)) - f i (X (ω' k)))) x ∂Measure.pi fun x => μ| := sorry

Tactic state before:
case h.h.h.h
Ω : 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)))
ω : Fin n → Ω
i : ι
⊢ |∑ k, (f i (X (ω k)) - ∫ (x : Fin n → Ω), (fun ω' => f i (X (ω' k))) x ∂Measure.pi fun x => μ)| =
    |∫ (x : Fin n → Ω), (fun ω' => ∑ k, (f i (X (ω k)) - f i (X (ω' k)))) x ∂Measure.pi fun x => μ|

Tactic:
apply congrArg
    symm
    apply extracted_7 hf hf' ω i

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_71.{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)))) (ω : Fin n → Ω) :
  (fun ω => ⨆ i, |∫ (x : Fin n → Ω), (fun ω' => ∑ k, (f i (X (ω k)) - f i (X (ω' k)))) x ∂Measure.pi fun x => μ|) ω ≤
    (fun ω => ⨆ i, ∫ (x : Fin n → Ω), (fun ω' => |∑ k, (f i (X (ω k)) - f i (X (ω' k)))|) x ∂Measure.pi fun x => μ)
      ω := sorry

Tactic state before:
case h
Ω : 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)))
ω : Fin n → Ω
⊢ (fun ω => ⨆ i, |∫ (x : Fin n → Ω), (fun ω' => ∑ k, (f i (X (ω k)) - f i (X (ω' k)))) x ∂Measure.pi fun x => μ|) ω ≤
    (fun ω => ⨆ i, ∫ (x : Fin n → Ω), (fun ω' => |∑ k, (f i (X (ω k)) - f i (X (ω' k)))|) x ∂Measure.pi fun x => μ) ω

Tactic:
apply ciSup_mono
    · apply bounded_aux hf hf'
    ·
  intro x
  have w :
    ‖∫ (x_1 : Fin n → Ω), ∑ k : Fin n, (f x (X (ω k)) - f x (X (x_1 k))) ∂μⁿ‖ ≤
      ∫ (x_1 : Fin n → Ω), ‖∑ k : Fin n, (f x (X (ω k)) - f x (X (x_1 k)))‖ ∂μⁿ :=
    by apply norm_integral_le_integral_norm
  simp only [norm_eq_abs] at w
  exact w

Tactic state after: