zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_7 (g : { t // t > 0 } → ℝ) (t_min : { t // t > 0 })
  (h_exp : ∀ (t : { t // t > 0 }), rexp (g t) ≥ rexp (g t_min)) : ⨅ t, rexp (g t) = rexp (g t_min) := sorry

Tactic state before:
ε a b : ℝ
m : ℕ
hm : m > 0
hε : ε > 0
hab : b > a
g✝ : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
t_min✝ : { t // t > 0 } := ⟨4 * ε / ((b - a) ^ 2 * ↑m), ⋯⟩
gt : ∀ (t : { t // t > 0 }), g✝ t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
h_rewrite : ∀ (t : { t // t > 0 }), g✝ t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min✝) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
h_inf : ∀ (t : { t // t > 0 }), g✝ t ≥ g✝ t_min✝
h_exp✝ : ∀ (t : { t // t > 0 }), rexp (g✝ t) ≥ rexp (g✝ t_min✝)
h_g_tmin : g✝ t_min✝ = -2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
h_exp_tmin : rexp (g✝ t_min✝) = rexp (-2 * ε ^ 2 / ((b - a) ^ 2 * ↑m))
h_inf_rewrite : ⨅ t, rexp (-↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8) = ⨅ t, rexp (g✝ t)
g : { t // t > 0 } → ℝ
t_min : { t // t > 0 }
h_exp : ∀ (t : { t // t > 0 }), rexp (g t) ≥ rexp (g t_min)
⊢ ⨅ t, rexp (g t) = rexp (g t_min)

Tactic:
apply le_antisymm
    ·
  have bdd : BddBelow (Set.range (fun t => rexp (g t))) :=
    by
    use rexp (g t_min)
    intro y hy
    rcases hy with ⟨t, rfl⟩
    exact h_exp t
  apply ciInf_le bdd
    ·
  have positive_reals_nonempty : Nonempty { t : ℝ // t > 0 } := by exact ⟨⟨1, by norm_num⟩⟩
  to_theorem apply le_ciInf intro t exact (h_exp t)

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

theorem extracted_formal_statement_8 (g : { t // t > 0 } → ℝ) (t_min : { t // t > 0 })
  (h_exp : ∀ (t : { t // t > 0 }), rexp (g t) ≥ rexp (g t_min)) : rexp (g t_min) ≤ ⨅ t, rexp (g t) := sorry

Tactic state before:
case a
ε a b : ℝ
m : ℕ
hm : m > 0
hε : ε > 0
hab : b > a
g✝ : { t // t > 0 } → ℝ := fun t => -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
t_min✝ : { t // t > 0 } := ⟨4 * ε / ((b - a) ^ 2 * ↑m), ⋯⟩
gt : ∀ (t : { t // t > 0 }), g✝ t = -↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8
h_rewrite : ∀ (t : { t // t > 0 }), g✝ t = ↑m * (b - a) ^ 2 / 8 * (↑t - ↑t_min✝) ^ 2 - 2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
h_inf : ∀ (t : { t // t > 0 }), g✝ t ≥ g✝ t_min✝
h_exp✝ : ∀ (t : { t // t > 0 }), rexp (g✝ t) ≥ rexp (g✝ t_min✝)
h_g_tmin : g✝ t_min✝ = -2 * ε ^ 2 / ((b - a) ^ 2 * ↑m)
h_exp_tmin : rexp (g✝ t_min✝) = rexp (-2 * ε ^ 2 / ((b - a) ^ 2 * ↑m))
h_inf_rewrite : ⨅ t, rexp (-↑t * ε + ↑t ^ 2 * ↑m * (b - a) ^ 2 / 8) = ⨅ t, rexp (g✝ t)
g : { t // t > 0 } → ℝ
t_min : { t // t > 0 }
h_exp : ∀ (t : { t // t > 0 }), rexp (g t) ≥ rexp (g t_min)
positive_reals_nonempty : Nonempty { t // t > 0 }
⊢ rexp (g t_min) ≤ ⨅ t, rexp (g t)

Tactic:
apply le_ciInf
    intro t
    exact (h_exp t)

Tactic state after:
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

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

Tactic 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

Tactic 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]
import Mathlib
import FoML


open MeasureTheory ProbabilityTheory Real

open scoped ENNReal

theorem extracted_formal_statement_1.{w, v, u} {n : ℕ} {Ω : Type u} [inst : MeasurableSpace Ω] {ι : Type v} {𝒳 : Type w}
  {μ : Measure Ω} [inst_1 : MeasurableSpace 𝒳] [inst_2 : Nonempty 𝒳] [inst_3 : Nonempty ι] [inst_4 : Countable ι]
  [inst_5 : IsProbabilityMeasure μ] (f : ι → 𝒳 → ℝ) (hf : ∀ (i : ι), Measurable (f i)) (X : Ω → 𝒳) (hX : Measurable X)
  {b : ℝ} (hb : 0 ≤ b) (hf' : ∀ (i : ι) (x : 𝒳), |f i x| ≤ b) {t : ℝ} (ht : 0 ≤ t) (ht' : t * b ^ 2 ≤ 1 / 2) {ε : ℝ}
  (hε : 0 ≤ ε) (hn_1 : ¬n = 0) (hn : 0 < n)
  (h_original_goal :
    ((Measure.pi fun x => μ) fun ω => 2 • rademacherComplexity n f μ X + ε ≤ uniformDeviation n f μ X (X ∘ ω)).toReal ≤
      rexp (-ε ^ 2 * t * ↑n)) :
  (fun ω => 2 • rademacherComplexity n f μ X + ε ≤ uniformDeviation n f μ X (X ∘ ω)) ⊆ fun ω =>
    ε ≤
      uniformDeviation n f μ X (X ∘ ω) -
        ∫ (x : Fin n → Ω), uniformDeviation n f μ X (X ∘ x) ∂Measure.pi fun x => μ := sorry

Tactic state before:
case neg
n : ℕ
Ω : Type u
inst✝⁵ : MeasurableSpace Ω
ι : Type v
𝒳 : Type w
μ : Measure Ω
inst✝⁴ : MeasurableSpace 𝒳
inst✝³ : Nonempty 𝒳
inst✝² : Nonempty ι
inst✝¹ : Countable ι
inst✝ : IsProbabilityMeasure μ
f : ι → 𝒳 → ℝ
hf : ∀ (i : ι), Measurable (f i)
X : Ω → 𝒳
hX : Measurable X
b : ℝ
hb : 0 ≤ b
hf' : ∀ (i : ι) (x : 𝒳), |f i x| ≤ b
t : ℝ
ht : 0 ≤ t
ht' : t * b ^ 2 ≤ 1 / 2
ε : ℝ
hε : 0 ≤ ε
hn✝ : ¬n = 0
hn : 0 < n
⊢ ((Measure.pi fun x => μ) fun ω => 2 • rademacherComplexity n f μ X + ε ≤ uniformDeviation n f μ X (X ∘ ω)).toReal ≤
    rexp (-ε ^ 2 * t * ↑n)

Tactic:
apply le_trans _ (uniformDeviation_mcdiarmid (μ := μ) hX hf hb hf' ht ht' hε)
    simp only [ge_iff_le, ne_eq, measure_ne_top, not_false_eq_true, ENNReal.toReal_le_toReal]
    apply measure_mono

Tactic state after:
[case h
 n : ℕ
 Ω : Type u
 inst✝⁵ : MeasurableSpace Ω
 ι : Type v
 𝒳 : Type w
 μ : Measure Ω
 inst✝⁴ : MeasurableSpace 𝒳
 inst✝³ : Nonempty 𝒳
 inst✝² : Nonempty ι
 inst✝¹ : Countable ι
 inst✝ : IsProbabilityMeasure μ
 f : ι → 𝒳 → ℝ
 hf : ∀ (i : ι), Measurable (f i)
 X : Ω → 𝒳
 hX : Measurable X
 b : ℝ
 hb : 0 ≤ b
 hf' : ∀ (i : ι) (x : 𝒳), |f i x| ≤ b
 t : ℝ
 ht : 0 ≤ t
 ht' : t * b ^ 2 ≤ 1 / 2
 ε : ℝ
 hε : 0 ≤ ε
 hn✝ : ¬n = 0
 hn : 0 < n
 ⊢ (fun ω => 2 • rademacherComplexity n f μ X + ε ≤ uniformDeviation n f μ X (X ∘ ω)) ⊆ fun ω =>
     ε ≤ uniformDeviation n f μ X (X ∘ ω) - ∫ (x : Fin n → Ω), uniformDeviation n f μ X (X ∘ x) ∂Measure.pi fun x => μ]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_0.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] {X : Ω → ℝ} {t a b : ℝ} (hX : AEMeasurable X μ) (h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b)
  (ht : t < 0) (h_original_goal : Integrable (fun ω => rexp (t * X ω)) μ) : -t > 0 := sorry

Tactic state before:
case inl
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
X : Ω → ℝ
t a b : ℝ
hX : AEMeasurable X μ
h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
ht : t < 0
⊢ Integrable (fun ω => rexp (t * X ω)) μ

Tactic:
rw [(by ext ω; rw [(by ring : -t * (-X ω) = t * X ω)] :
    (fun ω ↦ rexp (t * X ω)) = (fun ω ↦ rexp (-t * (-X ω))))]
    apply integrable_expt (-t) _ _ hX.neg
    ·
  filter_upwards [h] with ω h
  apply neg_le_neg h.1

Tactic state after:
[Ω : Type u_1
 m : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsFiniteMeasure μ
 X : Ω → ℝ
 t a b : ℝ
 hX : AEMeasurable X μ
 h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
 ht : t < 0
 ⊢ -t > 0]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_4 : Measurable rexp := sorry

Tactic state before:
case hF'_meas
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
t a b : ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
c : ℝ := ‖a‖ ⊔ ‖b‖
e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω)
e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
⊢ AEStronglyMeasurable (fun ω => rexp (t * X ω) * X ω) μ

Tactic:
apply AEMeasurable.aestronglyMeasurable
    apply AEMeasurable.mul _ hX
    apply Measurable.comp_aemeasurable' _ _

Tactic state after:
[Ω : Type u_1
 m : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsFiniteMeasure μ
 t a b : ℝ
 X : Ω → ℝ
 hX : AEMeasurable X μ
 h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
 c : ℝ := ‖a‖ ⊔ ‖b‖
 e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω)
 e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
 ⊢ Measurable rexp,
 Ω : Type u_1
 m : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsFiniteMeasure μ
 t a b : ℝ
 X : Ω → ℝ
 hX : AEMeasurable X μ
 h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
 c : ℝ := ‖a‖ ⊔ ‖b‖
 e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω)
 e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
 ⊢ AEMeasurable (fun x => t * X x) μ]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_5.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] (t a b : ℝ) {X : Ω → ℝ} (hX : AEMeasurable X μ) (h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b)
  (h_original_goal : AEStronglyMeasurable (fun ω => rexp (t * X ω) * X ω) μ) :
  AEMeasurable (fun x => t * X x) μ := sorry

Tactic state before:
case hF'_meas
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
t a b : ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
c : ℝ := ‖a‖ ⊔ ‖b‖
e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω)
e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
⊢ AEStronglyMeasurable (fun ω => rexp (t * X ω) * X ω) μ

Tactic:
apply AEMeasurable.aestronglyMeasurable
    apply AEMeasurable.mul _ hX
    apply Measurable.comp_aemeasurable' _ _

Tactic state after:
[Ω : Type u_1
 m : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsFiniteMeasure μ
 t a b : ℝ
 X : Ω → ℝ
 hX : AEMeasurable X μ
 h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
 c : ℝ := ‖a‖ ⊔ ‖b‖
 e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω)
 e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
 ⊢ Measurable rexp,
 Ω : Type u_1
 m : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsFiniteMeasure μ
 t a b : ℝ
 X : Ω → ℝ
 hX : AEMeasurable X μ
 h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
 c : ℝ := ‖a‖ ⊔ ‖b‖
 e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω)
 e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
 ⊢ AEMeasurable (fun x => t * X x) μ]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_9.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] (a b : ℝ) {X : Ω → ℝ} (hX : AEMeasurable X μ) (h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b)
  (t' : ℝ) : AEStronglyMeasurable (fun ω => rexp (t' * X ω) * X ω) μ := sorry

Tactic state before:
case hF_meas.hp
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
t a b : ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
c : ℝ := ‖a‖ ⊔ ‖b‖
e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω ^ 2
t' : ℝ
⊢ AEStronglyMeasurable (fun ω => rexp (t' * X ω) * X ω) μ

Tactic:
rw [aestronglyMeasurable_iff_aemeasurable]
    apply AEMeasurable.mul _ hX
    exact Measurable.comp_aemeasurable' measurable_exp (hX.const_mul t')

Tactic state after:
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_10.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] (t a b : ℝ) {X : Ω → ℝ} (hX : AEMeasurable X μ) (h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b)
  (h_original_goal : AEStronglyMeasurable (fun ω => rexp (t * X ω) * X ω ^ 2) μ) :
  AEMeasurable (fun a => X a ^ 2) μ := sorry

Tactic state before:
case hF'_meas
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
t a b : ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
c : ℝ := ‖a‖ ⊔ ‖b‖
e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω ^ 2
⊢ AEStronglyMeasurable (fun ω => rexp (t * X ω) * X ω ^ 2) μ

Tactic:
rw [aestronglyMeasurable_iff_aemeasurable]
    apply AEMeasurable.mul
    ·
  apply Measurable.comp_aemeasurable' _ _
  · exact measurable_exp
  · exact hX.const_mul t

Tactic state after:
[case hF'_meas.hg
 Ω : Type u_1
 m : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsFiniteMeasure μ
 t a b : ℝ
 X : Ω → ℝ
 hX : AEMeasurable X μ
 h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
 c : ℝ := ‖a‖ ⊔ ‖b‖
 e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
 e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω ^ 2
 ⊢ AEMeasurable (fun a => X a ^ 2) μ]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_11.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] (t a b : ℝ) {X : Ω → ℝ} (hX : AEMeasurable X μ) (h_1 : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b)
  (ω : Ω) (x : ℝ) (h : x ∈ Metric.ball t (|t| + 1)) :
  |rexp (x * X ω) * X ω ^ 2| ≤ rexp ((2 * |t| + 1) * |X ω|) * |X ω| ^ 2 := sorry

Tactic state before:
case h_bound
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
t a b : ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
h✝ : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
c : ℝ := ‖a‖ ⊔ ‖b‖
e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω ^ 2
bound : Ω → ℝ := fun ω => rexp ((2 * |t| + 1) * |X ω|) * |X ω| ^ 2
ω : Ω
x : ℝ
h : x ∈ Metric.ball t (|t| + 1)
⊢ |rexp (x * X ω) * X ω ^ 2| ≤ rexp ((2 * |t| + 1) * |X ω|) * |X ω| ^ 2

Tactic:
simp only [sq_abs]
    show |rexp (x * X ω) * X ω ^ 2| ≤ rexp ((2 * |t| + 1) * |X ω|) * X ω ^ 2
    calc
  _ = |rexp (x * X ω)| * |(X ω ^ 2)| := abs_mul (rexp (x * X ω)) (X ω ^ 2)
  _ = rexp (x * X ω) * (X ω ^ 2) := by simp
  _ ≤ rexp ((2 * |t| + 1) * |X ω|) * X ω ^ 2 :=
    by
    suffices rexp (x * X ω) ≤ rexp ((2 * |t| + 1) * |X ω|) from mul_le_mul_of_nonneg_right this (sq_nonneg (X ω))
    simp only [exp_le_exp]
    calc
      _ ≤ |x * X ω| := le_abs_self (x * X ω)
      _ = |x| * |X ω| := (abs_mul x (X ω))
      _ ≤ (2 * |t| + 1) * |X ω| :=
        by
        suffices |x| ≤ 2 * |t| + 1 from mul_le_mul_of_nonneg_right this (abs_nonneg (X ω))
        simp only [Metric.mem_ball] at h
        linarith [le_trans' (le_of_lt h) (abs_sub_abs_le_abs_sub x t)]

Tactic state after:
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_12.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] (a b : ℝ) {X : Ω → ℝ} (hX : AEMeasurable X μ) (h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b) :
  Integrable (fun x => X x ^ 2) μ := sorry

Tactic state before:
case bound_integrable.hg
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
t a b : ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
c : ℝ := ‖a‖ ⊔ ‖b‖
e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω ^ 2
⊢ Integrable (fun x => X x ^ 2) μ

Tactic:
rw [(by ext ω; ring : (fun ω ↦ X ω ^ 2) = (fun ω ↦ X ω * X ω))]
    apply MeasureTheory.Integrable.bdd_mul' (integrable_bounded a b hX h) (aestronglyMeasurable_iff_aemeasurable.mpr hX)
    ·
  filter_upwards [h] with x h
  exact (by simp; exact le_trans' (le_abs_self (max ‖a‖ ‖b‖)) (abs_le_max_abs_abs h.1 h.2) : ‖X x‖ ≤ |c|)

Tactic state after:
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_13.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] (t a b : ℝ) {X : Ω → ℝ} (hX : AEMeasurable X μ) (h_1 : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b) :
  let c := ‖a‖ ⊔ ‖b‖;
  ∀ (ω : Ω), X ω ∈ Set.Icc a b → ‖rexp ((2 * |t| + 1) * |X ω|)‖ ≤ ‖rexp ((2 * |t| + 1) * c)‖ := sorry

Tactic state before:
case h
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
t a b : ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
h✝ : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
c : ℝ := ‖a‖ ⊔ ‖b‖
e : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω
e' : ℝ → Ω → ℝ := fun t ω => rexp (t * X ω) * X ω ^ 2
ω : Ω
h : X ω ∈ Set.Icc a b
⊢ ‖rexp ((2 * |t| + 1) * |X ω|)‖ ≤ ‖rexp ((2 * |t| + 1) * c)‖

Tactic:
simp only [norm_eq_abs, abs_exp, exp_le_exp]
    rw [← (abs_eq_self.mpr (le_trans' (le_max_left |a| ‖b‖) (abs_nonneg a)) : |c| = c)]
    exact
  mul_le_mul_of_nonneg_left (le_trans' (le_abs_self (max ‖a‖ ‖b‖)) (abs_le_max_abs_abs h.1 h.2))
    (by linarith [abs_nonneg t] : 0 ≤ 2 * |t| + 1)

Tactic state after:
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_14.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] (t : ℝ) (f : ℝ → ℝ) {X : Ω → ℝ} (hX : AEMeasurable X μ) (ω : Ω)
  (w : (∂μ.tilted fun x => t * X x/∂μ) ω = ENNReal.ofReal (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ))
  (h_original_goal :
    (ENNReal.ofReal (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ)).toReal • f (X ω) =
      (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ) * f (X ω)) :
  0 ≤ rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ := sorry

Tactic state before:
case h
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
t : ℝ
f : ℝ → ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
ω : Ω
w : (∂μ.tilted fun x => t * X x/∂μ) ω = ENNReal.ofReal (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ)
⊢ (ENNReal.ofReal (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ)).toReal • f (X ω) =
    (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ) * f (X ω)

Tactic:
simp only [smul_eq_mul, mul_eq_mul_right_iff, ENNReal.toReal_ofReal_eq_iff]
    left
    have q2 : 0 ≤ μ[fun ω ↦ rexp (t * X ω)] :=
  by
  to_theorem apply integral_nonneg apply Pi.le_def.mpr _ intro i
  simp only [Pi.zero_apply]
  exact exp_nonneg (t * X i)

Tactic state after:
[case h.h
 Ω : Type u_1
 m : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsFiniteMeasure μ
 t : ℝ
 f : ℝ → ℝ
 X : Ω → ℝ
 hX : AEMeasurable X μ
 ω : Ω
 w : (∂μ.tilted fun x => t * X x/∂μ) ω = ENNReal.ofReal (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ)
 q2 : 0 ≤ ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ
 ⊢ 0 ≤ rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_15.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] [inst_1 : NeZero μ] (a b : ℝ) {X : Ω → ℝ} (hX : AEMeasurable X μ)
  (h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b) :
  let f := fun t => cgf X μ t;
  ∀ (t : ℝ),
    (∫ (x : Ω), (fun ω => id (X ω)) x ∂μ.tilted fun ω => t * X ω) =
        (∫ (x : Ω), (fun ω => rexp (t * X ω) * id (X ω)) x ∂μ) / ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ →
      HasDerivAt f (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) t := sorry

Tactic state before:
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝¹ : IsFiniteMeasure μ
inst✝ : NeZero μ
a b : ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
f : ℝ → ℝ := fun t => cgf X μ t
f' : ℝ → ℝ := fun t => ∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω
t : ℝ
g : ℝ → ℝ := fun t => ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ
g' : ℝ → ℝ := fun t => ∫ (x : Ω), (fun ω => rexp (t * X ω) * X ω) x ∂μ
r0 :
  (∫ (x : Ω), (fun ω => id (X ω)) x ∂μ.tilted fun ω => t * X ω) =
    (∫ (x : Ω), (fun ω => rexp (t * X ω) * id (X ω)) x ∂μ) / ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ
⊢ HasDerivAt f (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) t

Tactic:
simp only [id_eq, f'] at r0
    rw [r0]
    apply
  HasDerivAt.log (tilt_first_deriv _ _ _ hX h (integrable_deriv_expt t a b hX h))
    (mgf_pos' (NeZero.ne μ) (integrable_expt_bound hX h)).ne'

Tactic state after:
import Mathlib
import Optlib


open Set

theorem extracted_formal_statement_0.{u_1} {E : Type u_1} [inst : NormedAddCommGroup E] [inst_1 : InnerProductSpace ℝ E]
  [inst_2 : CompleteSpace E] [inst_3 : ProperSpace E] {x₀ : E} {f : E → ℝ} {f' : E → E} {h : E → ℝ}
  {alg : proximal_gradient_method f h f' x₀} (k : ℕ+)
  (h_original_goal :
    f (proximal_gradient_method.x f h f' x₀ ↑k) + h (proximal_gradient_method.x f h f' x₀ ↑k) -
          f (proximal_gradient_method.xm f h f' x₀) -
        h (proximal_gradient_method.xm f h f' x₀) ≤
      1 / (2 * ↑↑k * proximal_gradient_method.t f h f' x₀) * ‖x₀ - proximal_gradient_method.xm f h f' x₀‖ ^ 2) :
  2 * ↑↑k * proximal_gradient_method.t f h f' x₀ *
      (f (proximal_gradient_method.x f h f' x₀ ↑k) + h (proximal_gradient_method.x f h f' x₀ ↑k) -
          f (proximal_gradient_method.xm f h f' x₀) -
        h (proximal_gradient_method.xm f h f' x₀)) ≤
    ‖x₀ - proximal_gradient_method.xm f h f' x₀‖ ^ 2 := sorry

Tactic state before:
E : Type u_1
inst✝³ : NormedAddCommGroup E
inst✝² : InnerProductSpace ℝ E
inst✝¹ : CompleteSpace E
inst✝ : ProperSpace E
x₀ : E
f : E → ℝ
f' : E → E
h : E → ℝ
alg : proximal_gradient_method f h f' x₀
k : ℕ+
⊢ f (proximal_gradient_method.x f h f' x₀ ↑k) + h (proximal_gradient_method.x f h f' x₀ ↑k) -
        f (proximal_gradient_method.xm f h f' x₀) -
      h (proximal_gradient_method.xm f h f' x₀) ≤
    1 / (2 * ↑↑k * proximal_gradient_method.t f h f' x₀) * ‖x₀ - proximal_gradient_method.xm f h f' x₀‖ ^ 2

Tactic:
rw [mul_comm, mul_one_div, le_div_iff₀, mul_comm]
    have th : ContinuousOn (alg.t • h) univ := by apply ContinuousOn.const_smul alg.h₃ alg.t
    have th' : ConvexOn ℝ univ (alg.t • h) := by to_theorem apply ConvexOn.smul;linarith [alg.tpos];apply alg.hconv

Tactic state after:
[E : Type u_1
 inst✝³ : NormedAddCommGroup E
 inst✝² : InnerProductSpace ℝ E
 inst✝¹ : CompleteSpace E
 inst✝ : ProperSpace E
 x₀ : E
 f : E → ℝ
 f' : E → E
 h : E → ℝ
 alg : proximal_gradient_method f h f' x₀
 k : ℕ+
 th : ContinuousOn (proximal_gradient_method.t f h f' x₀ • h) univ
 th' : ConvexOn ℝ univ (proximal_gradient_method.t f h f' x₀ • h)
 ⊢ 2 * ↑↑k * proximal_gradient_method.t f h f' x₀ *
       (f (proximal_gradient_method.x f h f' x₀ ↑k) + h (proximal_gradient_method.x f h f' x₀ ↑k) -
           f (proximal_gradient_method.xm f h f' x₀) -
         h (proximal_gradient_method.xm f h f' x₀)) ≤
     ‖x₀ - proximal_gradient_method.xm f h f' x₀‖ ^ 2,
 E : Type u_1
 inst✝³ : NormedAddCommGroup E
 inst✝² : InnerProductSpace ℝ E
 inst✝¹ : CompleteSpace E
 inst✝ : ProperSpace E
 x₀ : E
 f : E → ℝ
 f' : E → E
 h : E → ℝ
 alg : proximal_gradient_method f h f' x₀
 k : ℕ+
 ⊢ 0 < 2 * ↑↑k * proximal_gradient_method.t f h f' x₀]