zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_40.{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 : ι) (i_1 : Fin n → Ω) (q : ∑ x, f i (X (ω' x)) ≤ ∑ x, b)
  (q' : ∑ x, -b ≤ ∑ x_1, f i (X (i_1 x_1))) : ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (i_1 x_1)) ≤ ↑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 μ
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 : ι
i_1 : Fin n → Ω
q : ∑ x, f i (X (ω' x)) ≤ ∑ x, b
q' : ∑ x, -b ≤ ∑ x_1, f i (X (i_1 x_1))
⊢ ∑ x, f i (X (ω' x)) - ∑ x_1, f i (X (i_1 x_1)) ≤ ↑n * (b + b)

Tactic:
simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] at q
    simp only [Finset.sum_neg_distrib, Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] at q'
    linarith

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_41.{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))
  (ω : Fin n → Ω) (i : ι) (k : Fin n) (a : k ∈ Finset.univ) : Measurable fun a => f i (X (ω k)) - f i (X (a k)) := sorry

Tactic state before:
case hf.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)
ω : Fin n → Ω
i : ι
k : Fin n
a✝ : k ∈ Finset.univ
⊢ Measurable fun a => f i (X (ω k)) - f i (X (a k))

Tactic:
apply Measurable.sub
    apply (hf i).comp measurable_const
    exact measurable_aux0 hf i k

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_42.{u_1, w, u} {Ω : Type u} [inst : MeasurableSpace Ω] {Z : Type w} {n : ℕ}
  {ι : Type u_1} {f : ι → Z → ℝ} {μ : Measure Ω} [inst_1 : IsProbabilityMeasure μ] [inst_2 : Nonempty ι]
  [inst_3 : Countable ι] {X : Ω → Z} (hf : ∀ (i : ι), Measurable (f i ∘ X)) {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) :
  |∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω.1 k))|| ≤ 2 ^ n * (↑n * b) := sorry

Tactic state before:
case h
Ω : Type u
inst✝³ : MeasurableSpace Ω
Z : Type w
n : ℕ
ι : Type u_1
f : ι → Z → ℝ
μ : Measure Ω
inst✝² : IsProbabilityMeasure μ
inst✝¹ : Nonempty ι
inst✝ : Countable ι
X : Ω → Z
hf : ∀ (i : ι), Measurable (f i ∘ X)
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)]
    rw [mul_comm (↑n * b)]

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


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

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

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✝¹ : Nonempty ι
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : (Fin n → Ω) × (Fin n → Ω)
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 ⊢ BddAbove (Set.range fun i => ∑ k, b),
 case h.H
 Ω : Type u
 inst✝³ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Nonempty ι
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : (Fin n → Ω) × (Fin n → Ω)
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 ⊢ ∀ (x : ι), ∑ k, |f x (X (ω.1 k))| ≤ ∑ k, b]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

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

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✝¹ : Nonempty ι
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : (Fin n → Ω) × (Fin n → Ω)
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 ⊢ BddAbove (Set.range fun i => ∑ k, b),
 case h.H
 Ω : Type u
 inst✝³ : MeasurableSpace Ω
 Z : Type w
 n : ℕ
 ι : Type u_1
 f : ι → Z → ℝ
 μ : Measure Ω
 inst✝² : IsProbabilityMeasure μ
 inst✝¹ : Nonempty ι
 inst✝ : Countable ι
 X : Ω → Z
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
 ω : (Fin n → Ω) × (Fin n → Ω)
 σ : Signs n
 a✝ : σ ∈ Finset.univ
 ⊢ ∀ (x : ι), ∑ k, |f x (X (ω.1 k))| ≤ ∑ k, b]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

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

Tactic:
apply Finset.sum_le_sum
    intro k _
    exact hf' i (X (ω.1 k))

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_46.{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 :
    Integrable (fun ω => ⨆ i, ∫ (ω' : Fin n → Ω), |∑ k, (f i (X (ω k)) - f i (X (ω' k)))| ∂Measure.pi fun x => μ)
      (Measure.pi fun x => μ)) :
  ∀ᵐ (x : Fin n → Ω) ∂Measure.pi fun x => μ,
    ‖⨆ i, ∫ (ω' : Fin n → Ω), |∑ k, (f i (X (x k)) - f i (X (ω' k)))| ∂Measure.pi fun x => μ‖ ≤ ↑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✝¹ : Nonempty ι
inst✝ : Countable ι
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
⊢ Integrable (fun ω => ⨆ i, ∫ (ω' : Fin n → Ω), |∑ k, (f i (X (ω k)) - f i (X (ω' k)))| ∂Measure.pi fun x => μ)
    (Measure.pi fun x => μ)

Tactic:
simp_rw [← memLp_one_iff_integrable]
    refine MemLp.of_bound ?_ (n * (b + b)) ?_
    ·
  apply (Measurable.iSup _).aestronglyMeasurable
  intro i
  to_theorem
    apply
      (Measurable.stronglyMeasurable _).integral_prod_left.measurable
        apply Measurable.abs apply Finset.univ.measurable_sum
  intro k _
  apply ((hf i).comp measurable_snd.eval).sub ((hf i).comp measurable_fst.eval)

Tactic state after:
[case refine_2
 Ω : 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
 ⊢ ∀ᵐ (x : Fin n → Ω) ∂Measure.pi fun x => μ,
     ‖⨆ i, ∫ (ω' : Fin n → Ω), |∑ k, (f i (X (x k)) - f i (X (ω' k)))| ∂Measure.pi fun x => μ‖ ≤ ↑n * (b + b)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_47.{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 :
    Integrable
      (fun ω => ∫ (x : Fin n → Ω), (fun ω' => ⨆ i, |∑ k, (f i (X (ω k)) - f i (X (ω' k)))|) x ∂Measure.pi fun x => μ)
      (Measure.pi fun x => μ)) :
  ∀ᵐ (x : Fin n → Ω) ∂Measure.pi fun x => μ,
    ‖∫ (x_1 : Fin n → Ω), ⨆ i, |∑ k, (f i (X (x k)) - f i (X (x_1 k)))| ∂Measure.pi fun x => μ‖ ≤ ↑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
⊢ Integrable
    (fun ω => ∫ (x : Fin n → Ω), (fun ω' => ⨆ i, |∑ k, (f i (X (ω k)) - f i (X (ω' k)))|) x ∂Measure.pi fun x => μ)
    (Measure.pi fun x => μ)

Tactic:
simp_rw [← memLp_one_iff_integrable]
    refine MemLp.of_bound ?_ (n * (b + b)) ?_
    ·
  apply Measurable.aestronglyMeasurable
  to_theorem
    apply
      StronglyMeasurable.measurable refine StronglyMeasurable.integral_prod_left ?_ apply Measurable.stronglyMeasurable
  dsimp [Function.uncurry_def]
  to_theorem apply Measurable.iSup intro i apply Measurable.abs
  to_theorem apply Finset.univ.measurable_sum intro k _ apply Measurable.sub
  apply (hf i).comp measurable_snd.eval
  apply (hf i).comp measurable_fst.eval

Tactic state after:
[case refine_2
 Ω : 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
 ⊢ ∀ᵐ (x : Fin n → Ω) ∂Measure.pi fun x => μ,
     ‖∫ (x_1 : Fin n → Ω), ⨆ i, |∑ k, (f i (X (x k)) - f i (X (x_1 k)))| ∂Measure.pi fun x => μ‖ ≤ ↑n * (b + b)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

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

Tactic:
apply StronglyMeasurable.measurable
    refine StronglyMeasurable.integral_prod_left ?_
    apply Measurable.stronglyMeasurable

Tactic state after:
[case refine_1.hf.hf.hf
 Ω : 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
 ⊢ Measurable (Function.uncurry fun x ω => ⨆ i, |∑ k, (f i (X (ω k)) - f i (X (x k)))|)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_49.{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 → Ω)
  (this :
    (∫ (x : Fin n → Ω), ‖⨆ i, |∑ k, (f i (X (ω k)) - f i (X (x k)))|‖ ∂Measure.pi fun x => μ) ≤
      ∫ (x : Fin n → Ω), ⨆ i, ∑ k, (b + b) ∂Measure.pi fun x => μ)
  (h : (∫ (x : Fin n → Ω), ⨆ i, ∑ k, (b + b) ∂Measure.pi fun x => μ) = ↑n * (b + b)) :
  ‖∫ (x : Fin n → Ω), ⨆ i, |∑ k, (f i (X (ω k)) - f i (X (x k)))| ∂Measure.pi fun x => μ‖ ≤ ↑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 → Ω
this :
  (∫ (x : Fin n → Ω), ‖⨆ i, |∑ k, (f i (X (ω k)) - f i (X (x k)))|‖ ∂Measure.pi fun x => μ) ≤
    ∫ (x : Fin n → Ω), ⨆ i, ∑ k, (b + b) ∂Measure.pi fun x => μ
h : (∫ (x : Fin n → Ω), ⨆ i, ∑ k, (b + b) ∂Measure.pi fun x => μ) = ↑n * (b + b)
⊢ ‖∫ (x : Fin n → Ω), ⨆ i, |∑ k, (f i (X (ω k)) - f i (X (x k)))| ∂Measure.pi fun x => μ‖ ≤ ↑n * (b + b)

Tactic:
rw [← h]
    apply le_trans _ this
    apply norm_integral_le_integral_norm

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

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

Tactic:
apply integral_mono
    · exact integrable_aux5 hf hf' ω
    ·
  simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, smul_add, nsmul_eq_mul, ciSup_const,
    integrable_const]

Tactic state after:
[case refine_2.h.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 → Ω
 ⊢ (fun a => ‖⨆ i, |∑ k, (f i (X (ω k)) - f i (X (a k)))|‖) ≤ fun a => ⨆ i, ∑ k, (b + b)]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

Tactic:
apply congrArg
    funext ω'
    exact Finset.sum_sub_distrib

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

Tactic:
apply integral_sub
    · simp
    ·
  apply integrable_finset_sum
  exact fun i_1 a ↦ integrable_aux0 hf hf' i i_1

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_53.{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 :
    ∫ (x : (Fin n → Ω) × (Fin n → Ω)),
          (fun ω => (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω.1 k))|)
            x ∂(Measure.pi fun x => μ).prod (Measure.pi fun x => μ) +
        ∫ (x : (Fin n → Ω) × (Fin n → Ω)),
          (fun ω => (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω.2 k))|)
            x ∂(Measure.pi fun x => μ).prod (Measure.pi fun x => μ) =
      2 *
        ∫ (x : Fin n → Ω),
          (fun ω => (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|)
            x ∂Measure.pi fun x => μ) :
  ∫ (x : (Fin n → Ω) × (Fin n → Ω)),
      (fun ω => (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω.2 k))|)
        x ∂(Measure.pi fun x => μ).prod (Measure.pi fun x => μ) =
    ∫ (x : Fin n → Ω),
      (fun ω => (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|)
        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 : ℝ
hf' : ∀ (i : ι) (z : Z), |f i z| ≤ b
⊢ ∫ (x : (Fin n → Ω) × (Fin n → Ω)),
        (fun ω => (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω.1 k))|)
          x ∂(Measure.pi fun x => μ).prod (Measure.pi fun x => μ) +
      ∫ (x : (Fin n → Ω) × (Fin n → Ω)),
        (fun ω => (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω.2 k))|)
          x ∂(Measure.pi fun x => μ).prod (Measure.pi fun x => μ) =
    2 *
      ∫ (x : Fin n → Ω),
        (fun ω => (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|) x ∂Measure.pi fun x => μ

Tactic:
rw [two_mul]
    apply congrArg₂
    ·
  rw [integral_prod _ _]
  · dsimp only [Prod.fst]
    congr
    ext
    rw [integral_const]
    simp
  · exact integrable_aux6 hf hf'

Tactic state after:
[case hy
 Ω : 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
 ⊢ ∫ (x : (Fin n → Ω) × (Fin n → Ω)),
       (fun ω => (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω.2 k))|)
         x ∂(Measure.pi fun x => μ).prod (Measure.pi fun x => μ) =
     ∫ (x : Fin n → Ω),
       (fun ω => (↑(Fintype.card (Signs n)))⁻¹ * ∑ σ, ⨆ i, |∑ k, ↑↑(σ k) * f i (X (ω k))|) x ∂Measure.pi fun x => μ]