theorem extracted_formal_statement_0.{w, v, u} {n : ℕ} {Ω : Type u} [inst : MeasurableSpace Ω] {ι : Type v} {𝒳 : Type w}
  {μ : Measure Ω} {f : ι → 𝒳 → ℝ} [inst_1 : Nonempty ι] [inst_2 : Countable ι] [inst_3 : IsProbabilityMeasure μ]
  (hn : 0 < n) (X : Ω → 𝒳) (hf : ∀ (i : ι), Measurable (f i ∘ X)) {b : ℝ} (hb : 0 ≤ b)
  (hf' : ∀ (i : ι) (x : 𝒳), |f i x| ≤ b)
  (h_original_goal :
    (∫ (x : Fin n → Ω), (fun ω => uniformDeviation n f μ X (X ∘ ω)) x ∂Measure.pi fun x => μ) ≤
      2 • rademacherComplexity n f μ X) :
  ↑n * 2 • rademacherComplexity n f μ X = (2 * n) • rademacherComplexity n f μ X := sorry

State before:
n : ℕ
Ω : Type u
inst✝³ : MeasurableSpace Ω
ι : Type v
𝒳 : Type w
μ : Measure Ω
f : ι → 𝒳 → ℝ
inst✝² : Nonempty ι
inst✝¹ : Countable ι
inst✝ : IsProbabilityMeasure μ
hn : 0 < n
X : Ω → 𝒳
hf : ∀ (i : ι), Measurable (f i ∘ X)
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (x : 𝒳), |f i x| ≤ b
⊢ (∫ (x : Fin n → Ω), (fun ω => uniformDeviation n f μ X (X ∘ ω)) x ∂Measure.pi fun x => μ) ≤
    2 • rademacherComplexity n f μ X

Tactic: apply le_of_mul_le_mul_left _ (Nat.cast_pos.mpr hn)
    convert expectation_le_rademacher (μ := μ) (n := n) hf hb hf' using 1
    ·
  rw [← integral_mul_left]
  to_theorem
    apply
      integral_congr_ae (Filter.EventuallyEq.of_eq _)ext ω rw [uniformDeviation, Real.mul_iSup_of_nonneg (by norm_num)]
  to_theorem
    apply
      congr_arg _
        (funext (fun i ↦ ?_))rw [← show |(n : ℝ)| = n from abs_of_nonneg (by norm_num), ← abs_mul]apply congr_arg
  simp only [Nat.abs_cast, Function.comp_apply, nsmul_eq_mul]
  field_simp

State after:
[case h.e'_4
 n : ℕ
 Ω : Type u
 inst✝³ : MeasurableSpace Ω
 ι : Type v
 𝒳 : Type w
 μ : Measure Ω
 f : ι → 𝒳 → ℝ
 inst✝² : Nonempty ι
 inst✝¹ : Countable ι
 inst✝ : IsProbabilityMeasure μ
 hn : 0 < n
 X : Ω → 𝒳
 hf : ∀ (i : ι), Measurable (f i ∘ X)
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (x : 𝒳), |f i x| ≤ b
 ⊢ ↑n * 2 • rademacherComplexity n f μ X = (2 * n) • rademacherComplexity n f μ X]

Relevant lemmas:
error