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) (hτ : 0 ≤ τ) (hx_le_1 : x ≤ 1)
  (h_original_goal : rexp (τ * x) ≤ 1 + τ * x + x ^ 2 * (rexp τ - 1 - τ)) :
  rexp (τ * x) - (1 + τ * x + x ^ 2 * (rexp τ - 1 - τ)) ≤ 0 := sorry

Tactic state before:
x τ : ℝ
hx : |x| ≤ 1
hτ : 0 ≤ τ
hx_le_1 : x ≤ 1
⊢ rexp (τ * x) ≤ 1 + τ * x + x ^ 2 * (rexp τ - 1 - τ)

Tactic:
apply le_of_sub_nonpos
    set f : ℝ → ℝ := fun τ => rexp (τ * x) - (1 + τ * x + x ^ 2 * (rexp τ - 1 - τ))
    set f' : ℝ → ℝ := fun τ => rexp (τ * x) * x - (x + x ^ 2 * (rexp τ - 1))

Tactic state after:
[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))
 ⊢ rexp (τ * x) - (1 + τ * x + x ^ 2 * (rexp τ - 1 - τ)) ≤ 0]
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_1 (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) : u * x ≤ u := sorry

Tactic state before:
case 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)
⊢ rexp (u * x) * x * x ≤ x ^ 2 * rexp u

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

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)
 ⊢ u * x ≤ u]
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_2.{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) (ω : Ω), |X i ω| ≤ 1 → ‖rexp (τ * X i ω)‖ ≤ rexp τ → τ * X i ω ≤ τ := 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 ω)
i : Fin n
ω : Ω
hω : |X i ω| ≤ 1
⊢ ‖rexp (τ * X i ω)‖ ≤ rexp τ

Tactic:
rw [norm_eq_abs, abs_of_nonneg (exp_pos _).le]
    rw [exp_le_exp]
    have h := mul_le_mul_of_nonneg_left (abs_le.mp hω).2 (hlam)

Tactic state after:
[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 ω)
 i : Fin n
 ω : Ω
 hω : |X i ω| ≤ 1
 h : τ * X i ω ≤ τ * 1
 ⊢ τ * X i ω ≤ τ]
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_3.{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 * τ) → S ω ≤ ↑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

Tactic state after:
[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
 ⊢ S ω ≤ ↑n]
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_4.{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 τ) →
        (∀ᵐ (ω : Ω) ∂μ, ‖rexp (τ * S ω)‖ ≤ rexp (↑n * τ)) → HasFiniteIntegral (fun ω => rexp (τ * S ω)) μ := sorry

Tactic state before:
case right
Ω : 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_sum_bound : ∀ᵐ (ω : Ω) ∂μ, ‖rexp (τ * S ω)‖ ≤ rexp (↑n * τ)
⊢ HasFiniteIntegral (fun ω => rexp (τ * S ω)) μ

Tactic:
apply HasFiniteIntegral.mono' (g := fun _ ↦ Real.exp (↑n * τ))
    ·
  simp only [HasFiniteIntegral]
  rw [lintegral_const]
  simp [mul_eq_top, ENNReal.ofReal_lt_top]
    · exact h_sum_bound

Tactic state after:
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_5.{u_1} {Ω : Type u_1} [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) (i : Fin n) (ω : Ω) (hω : |X i ω| ≤ 1)
  (this : X i ω ∈ Icc (-1) 1) (h_original_goal : rexp (τ * X i ω) ∈ Icc (rexp (-τ)) (rexp τ)) :
  rexp (τ * X i ω) ≤ rexp τ := sorry

Tactic state before:
case h
Ω : Type u_1
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
i : Fin n
ω : Ω
hω : |X i ω| ≤ 1
this : X i ω ∈ Icc (-1) 1
⊢ rexp (τ * X i ω) ∈ Icc (rexp (-τ)) (rexp τ)

Tactic:
simp only [Set.mem_Icc] at this
    constructor
    ·
  apply Real.exp_le_exp.mpr
  to_theorem rw [mul_comm]have h := mul_le_mul_of_nonneg_left this.1 (hlam)linarith [h]

Tactic state after:
[case h.right
 Ω : Type u_1
 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
 i : Fin n
 ω : Ω
 hω : |X i ω| ≤ 1
 this : -1 ≤ X i ω ∧ X i ω ≤ 1
 ⊢ rexp (τ * X i ω) ≤ rexp τ]
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_6.{u_1} {Ω : Type u_1} [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) (i : Fin n) (ω : Ω) (hω : |X i ω| ≤ 1)
  (this : -1 ≤ X i ω ∧ X i ω ≤ 1) : -τ ≤ τ * X i ω := sorry

Tactic state before:
case h.left
Ω : Type u_1
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
i : Fin n
ω : Ω
hω : |X i ω| ≤ 1
this : -1 ≤ X i ω ∧ X i ω ≤ 1
⊢ -τ ≤ τ * X i ω

Tactic:
rw [mul_comm]
    have h := mul_le_mul_of_nonneg_left this.1 (hlam)
    linarith [h]

Tactic state after:
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_7.{u_1} {Ω : Type u_1} [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) (i : Fin n) (ω : Ω) (hω : |X i ω| ≤ 1)
  (this : -1 ≤ X i ω ∧ X i ω ≤ 1) : τ * X i ω ≤ τ := sorry

Tactic state before:
case h.right
Ω : Type u_1
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
i : Fin n
ω : Ω
hω : |X i ω| ≤ 1
this : -1 ≤ X i ω ∧ X i ω ≤ 1
⊢ τ * X i ω ≤ τ

Tactic:
rw [mul_comm]
    have h := mul_le_mul_of_nonneg_left this.2 (hlam)
    linarith [h]

Tactic state after:
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_8.{u_1} {Ω : Type u_1} [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) (τ : ℝ) (i : Fin n) (h1 : Integrable (fun ω => 1 + τ * X i ω) μ)
  (h_bound : ∀ᵐ (a : Ω) ∂μ, X i a ^ 2 ≤ 1) (h_lbound : ∀ᵐ (a : Ω) ∂μ, X i a ^ 2 ≥ 0) (a : Ω) (ha : X i a ^ 2 ≤ 1)
  (hlb : X i a ^ 2 ≥ 0) (h_original_goal : X i a ^ 2 ∈ Icc 0 1) : X i a ^ 2 ≤ 1 := sorry

Tactic state before:
case h
Ω : Type u_1
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
τ : ℝ
i : Fin n
h1 : Integrable (fun ω => 1 + τ * X i ω) μ
h_bound : ∀ᵐ (a : Ω) ∂μ, X i a ^ 2 ≤ 1
h_lbound : ∀ᵐ (a : Ω) ∂μ, X i a ^ 2 ≥ 0
a : Ω
ha : X i a ^ 2 ≤ 1
hlb : X i a ^ 2 ≥ 0
⊢ X i a ^ 2 ∈ Icc 0 1

Tactic:
simp only [Set.mem_Icc]
    constructor
    · exact hlb

Tactic state after:
[case h.right
 Ω : Type u_1
 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
 τ : ℝ
 i : Fin n
 h1 : Integrable (fun ω => 1 + τ * X i ω) μ
 h_bound : ∀ᵐ (a : Ω) ∂μ, X i a ^ 2 ≤ 1
 h_lbound : ∀ᵐ (a : Ω) ∂μ, X i a ^ 2 ≥ 0
 a : Ω
 ha : X i a ^ 2 ≤ 1
 hlb : X i a ^ 2 ≥ 0
 ⊢ X i a ^ 2 ≤ 1]
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_9.{u_1} {Ω : Type u_1} [inst : MeasurableSpace Ω] (μ : Measure Ω)
  [inst_1 : IsProbabilityMeasure μ] {n : ℕ} {X : Fin n → Ω → ℝ} (hXm : ∀ (i : Fin n), Measurable (X i))
  (hXi : iIndepFun X μ) (hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1)
  (hμX : ∀ (i : Fin n), ∫ (x : Ω), X i x ∂μ = 0) (σ : ℝ) (hσ : ∀ (i : Fin n), σ ^ 2 = ∫ (x : Ω), (X i ^ 2) x ∂μ)
  (ε τ : ℝ) (hτ : τ ≥ 0)
  (chernoff_bound :
    τ ≥ 0 →
      Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ →
        (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-τ * ε) * mgf (fun ω => ∑ i, X i ω) μ τ)
  (h_chernoff :
    Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ →
      (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-τ * ε) * mgf (fun ω => ∑ i, X i ω) μ τ)
  (h_integ : Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ) (t : ℝ) (hXmeas : ∀ (i : Fin n), Measurable (X i)) :
  mgf (fun ω => ∑ i, X i ω) μ t = ∏ i, mgf (X i) μ t := sorry

Tactic state before:
Ω : Type u_1
inst✝¹ : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
n : ℕ
X : Fin n → Ω → ℝ
hXm : ∀ (i : Fin n), Measurable (X i)
hXi : iIndepFun X μ
hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1
hμX : ∀ (i : Fin n), ∫ (x : Ω), X i x ∂μ = 0
σ : ℝ
hσ : ∀ (i : Fin n), σ ^ 2 = ∫ (x : Ω), (X i ^ 2) x ∂μ
ε τ : ℝ
hτ : τ ≥ 0
chernoff_bound :
  τ ≥ 0 →
    Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ →
      (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-τ * ε) * mgf (fun ω => ∑ i, X i ω) μ τ
h_chernoff :
  Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ →
    (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-τ * ε) * mgf (fun ω => ∑ i, X i ω) μ τ
h_integ : Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ
t : ℝ
hXmeas : ∀ (i : Fin n), Measurable (X i)
⊢ mgf (fun ω => ∑ i, X i ω) μ t = ∏ i, mgf (X i) μ t

Tactic:
rw [← iIndepFun.mgf_sum hXi hXmeas Finset.univ]
    congr with x
    rw [Finset.sum_apply]

Tactic state after:
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_10.{u_1} {Ω : Type u_1} [inst : MeasurableSpace Ω] (μ : Measure Ω)
  [inst_1 : IsProbabilityMeasure μ] {n : ℕ} {X : Fin n → Ω → ℝ} (hXm : ∀ (i : Fin n), Measurable (X i))
  (hXi : iIndepFun X μ) (hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1)
  (hμX : ∀ (i : Fin n), ∫ (x : Ω), X i x ∂μ = 0) (σ : ℝ) (hσ : ∀ (i : Fin n), σ ^ 2 = ∫ (x : Ω), (X i ^ 2) x ∂μ)
  (ε τ : ℝ) (hτ : τ ≥ 0)
  (chernoff_bound :
    τ ≥ 0 →
      Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ →
        (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-τ * ε) * mgf (fun ω => ∑ i, X i ω) μ τ)
  (h_chernoff :
    Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ →
      (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-τ * ε) * mgf (fun ω => ∑ i, X i ω) μ τ)
  (h_integ : Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ)
  (h_ysum_mgf : ∀ (t : ℝ), mgf (fun ω => ∑ i, X i ω) μ t = ∏ i, mgf (X i) μ t)
  (h_original_goal : (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-(τ * ε) + ↑n * σ ^ 2 * (rexp τ - 1 - τ))) :
  rexp (-(τ * ε)) * ∏ i, mgf (X i) μ τ ≤ rexp (-(τ * ε) + ↑n * σ ^ 2 * (rexp τ - 1 - τ)) := sorry

Tactic state before:
Ω : Type u_1
inst✝¹ : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
n : ℕ
X : Fin n → Ω → ℝ
hXm : ∀ (i : Fin n), Measurable (X i)
hXi : iIndepFun X μ
hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1
hμX : ∀ (i : Fin n), ∫ (x : Ω), X i x ∂μ = 0
σ : ℝ
hσ : ∀ (i : Fin n), σ ^ 2 = ∫ (x : Ω), (X i ^ 2) x ∂μ
ε τ : ℝ
hτ : τ ≥ 0
chernoff_bound :
  τ ≥ 0 →
    Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ →
      (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-τ * ε) * mgf (fun ω => ∑ i, X i ω) μ τ
h_chernoff :
  Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ →
    (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-τ * ε) * mgf (fun ω => ∑ i, X i ω) μ τ
h_integ : Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ
h_ysum_mgf : ∀ (t : ℝ), mgf (fun ω => ∑ i, X i ω) μ t = ∏ i, mgf (X i) μ t
⊢ (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-(τ * ε) + ↑n * σ ^ 2 * (rexp τ - 1 - τ))

Tactic:
rw [h_ysum_mgf] at chernoff_bound
    simp [hτ, h_integ] at chernoff_bound
    suffices rexp (-(τ * ε)) * ∏ i, mgf (X i) μ τ ≤ rexp (-(τ * ε) + n * σ ^ 2 * (rexp τ - 1 - τ)) by linarith

Tactic state after:
[Ω : Type u_1
 inst✝¹ : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsProbabilityMeasure μ
 n : ℕ
 X : Fin n → Ω → ℝ
 hXm : ∀ (i : Fin n), Measurable (X i)
 hXi : iIndepFun X μ
 hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1
 hμX : ∀ (i : Fin n), ∫ (x : Ω), X i x ∂μ = 0
 σ : ℝ
 hσ : ∀ (i : Fin n), σ ^ 2 = ∫ (x : Ω), (X i ^ 2) x ∂μ
 ε τ : ℝ
 hτ : τ ≥ 0
 h_chernoff :
   Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ →
     (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-τ * ε) * mgf (fun ω => ∑ i, X i ω) μ τ
 h_integ : Integrable (fun ω => rexp (τ * ∑ i, X i ω)) μ
 h_ysum_mgf : ∀ (t : ℝ), mgf (fun ω => ∑ i, X i ω) μ t = ∏ i, mgf (X i) μ t
 chernoff_bound : (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-(τ * ε)) * ∏ i, mgf (X i) μ τ
 ⊢ rexp (-(τ * ε)) * ∏ i, mgf (X i) μ τ ≤ rexp (-(τ * ε) + ↑n * σ ^ 2 * (rexp τ - 1 - τ))]
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_12.{u_1} {Ω : Type u_1} [inst : MeasurableSpace Ω] (μ : Measure Ω)
  [inst_1 : IsProbabilityMeasure μ] {n : ℕ} (hn : n > 0) {X : Fin n → Ω → ℝ} (hXm : ∀ (i : Fin n), Measurable (X i))
  (hXi : iIndepFun X μ) (hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1)
  (hμX : ∀ (i : Fin n), ∫ (x : Ω), X i x ∂μ = 0) (σ : ℝ) (hσ_pos : σ > 0)
  (hσ : ∀ (i : Fin n), σ ^ 2 = ∫ (x : Ω), (X i ^ 2) x ∂μ) (ε : ℝ) (hε : ε > 0) (ht_sq : 0 ≤ σ ^ 2)
  (bennett_bound : ∀ τ ≥ 0, (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-(τ * ε) + ↑n * σ ^ 2 * (rexp τ - 1 - τ)))
  (bennett_bound_τ_ :
    (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤
      rexp
        (-(log (1 + ε / (↑n * σ ^ 2)) * ε) +
          ↑n * σ ^ 2 * (rexp (log (1 + ε / (↑n * σ ^ 2))) - 1 - log (1 + ε / (↑n * σ ^ 2))))) :
  (μ {ω | ∑ i, X i ω ≥ ε}).toReal ≤
    rexp
      (-(log (1 + ε / (↑n * σ ^ 2)) * ε) +
        ↑n * σ ^ 2 * (1 + ε / (↑n * σ ^ 2) - 1 - log (1 + ε / (↑n * σ ^ 2)))) := sorry

Tactic state before:
Ω : Type u_1
inst✝¹ : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
n : ℕ
hn : n > 0
X : Fin n → Ω → ℝ
hXm : ∀ (i : Fin n), Measurable (X i)
hXi : iIndepFun X μ
hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1
hμX : ∀ (i : Fin n), ∫ (x : Ω), X i x ∂μ = 0
σ : ℝ
hσ_pos : σ > 0
hσ : ∀ (i : Fin n), σ ^ 2 = ∫ (x : Ω), (X i ^ 2) x ∂μ
ε : ℝ
hε : ε > 0
S : Ω → ℝ := fun ω => ∑ i, X i ω
ht_sq : 0 ≤ σ ^ 2
bennett_bound : ∀ τ ≥ 0, (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-(τ * ε) + ↑n * σ ^ 2 * (rexp τ - 1 - τ))
τ_ : ℝ := log (1 + ε / (↑n * σ ^ 2))
τ_nonneg : τ_ ≥ 0
bennett_bound_τ_ :
  (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤
    rexp
      (-(log (1 + ε / (↑n * σ ^ 2)) * ε) +
        ↑n * σ ^ 2 * (rexp (log (1 + ε / (↑n * σ ^ 2))) - 1 - log (1 + ε / (↑n * σ ^ 2))))
⊢ (μ {ω | ∑ i, X i ω ≥ ε}).toReal ≤
    rexp (-(log (1 + ε / (↑n * σ ^ 2)) * ε) + ↑n * σ ^ 2 * (1 + ε / (↑n * σ ^ 2) - 1 - log (1 + ε / (↑n * σ ^ 2))))

Tactic:
rw [exp_log] at bennett_bound_τ_
    exact bennett_bound_τ_
    positivity

Tactic state after:
import Mathlib
import FoML


open scoped Topology

open MeasureTheory ProbabilityTheory BigOperators ENNReal Real Set Filter Asymptotics

theorem extracted_formal_statement_15.{u_1} {Ω : Type u_1} [inst : MeasurableSpace Ω] (μ : Measure Ω)
  [inst_1 : IsProbabilityMeasure μ] {n : ℕ} (hn : n > 0) {X : Fin n → Ω → ℝ} (hXm : ∀ (i : Fin n), Measurable (X i))
  (hXi : iIndepFun X μ) (hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1)
  (hμX : ∀ (i : Fin n), ∫ (x : Ω), X i x ∂μ = 0) (σ : ℝ) (hσ_pos : σ > 0)
  (hσ : ∀ (i : Fin n), σ ^ 2 = ∫ (x : Ω), (X i ^ 2) x ∂μ) (ε : ℝ) (hε : ε > 0) (ht_sq : 0 ≤ σ ^ 2)
  (bennett_bound : ∀ τ ≥ 0, (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-(τ * ε) + ↑n * σ ^ 2 * (rexp τ - 1 - τ))) :
  let τ_ := log (1 + ε / (↑n * σ ^ 2));
  τ_ ≥ 0 →
    (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-(τ_ * ε) + ↑n * σ ^ 2 * (rexp τ_ - 1 - τ_)) →
      ↑n * σ ^ 2 * (1 + ε / (↑n * σ ^ 2) - 1 - log (1 + ε / (↑n * σ ^ 2))) =
          ε - ↑n * σ ^ 2 * log (1 + ε / (↑n * σ ^ 2)) →
        rexp (-(↑n * σ ^ 2 * ((1 + ε / (↑n * σ ^ 2)) * log (1 + ε / (↑n * σ ^ 2)) - ε / (↑n * σ ^ 2)))) =
            rexp (-(↑n * σ ^ 2 * log (1 + ε / (↑n * σ ^ 2)) + ε * log (1 + ε / (↑n * σ ^ 2)) - ε)) →
          let z := log (1 + ε / (↑n * σ ^ 2));
          (μ {ω | ∑ i, X i ω ≥ ε}).toReal ≤ rexp (-(z * ε) + (ε - ↑n * σ ^ 2 * z)) →
            z = log (1 + ε / (↑n * σ ^ 2)) →
              rexp (-(z * ε) + (ε - ↑n * σ ^ 2 * z)) = rexp (-(↑n * σ ^ 2 * z + ε * z - ε)) := sorry

Tactic state before:
Ω : Type u_1
inst✝¹ : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
n : ℕ
hn : n > 0
X : Fin n → Ω → ℝ
hXm : ∀ (i : Fin n), Measurable (X i)
hXi : iIndepFun X μ
hX_bdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) ∂μ, |X i ω| ≤ 1
hμX : ∀ (i : Fin n), ∫ (x : Ω), X i x ∂μ = 0
σ : ℝ
hσ_pos : σ > 0
hσ : ∀ (i : Fin n), σ ^ 2 = ∫ (x : Ω), (X i ^ 2) x ∂μ
ε : ℝ
hε : ε > 0
S : Ω → ℝ := fun ω => ∑ i, X i ω
ht_sq : 0 ≤ σ ^ 2
bennett_bound : ∀ τ ≥ 0, (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-(τ * ε) + ↑n * σ ^ 2 * (rexp τ - 1 - τ))
τ_ : ℝ := log (1 + ε / (↑n * σ ^ 2))
τ_nonneg : τ_ ≥ 0
bennett_bound_τ_ : (μ {ω | ε ≤ ∑ i, X i ω}).toReal ≤ rexp (-(τ_ * ε) + ↑n * σ ^ 2 * (rexp τ_ - 1 - τ_))
this✝ :
  ↑n * σ ^ 2 * (1 + ε / (↑n * σ ^ 2) - 1 - log (1 + ε / (↑n * σ ^ 2))) = ε - ↑n * σ ^ 2 * log (1 + ε / (↑n * σ ^ 2))
this :
  rexp (-(↑n * σ ^ 2 * ((1 + ε / (↑n * σ ^ 2)) * log (1 + ε / (↑n * σ ^ 2)) - ε / (↑n * σ ^ 2)))) =
    rexp (-(↑n * σ ^ 2 * log (1 + ε / (↑n * σ ^ 2)) + ε * log (1 + ε / (↑n * σ ^ 2)) - ε))
z : ℝ := log (1 + ε / (↑n * σ ^ 2))
bound : (μ {ω | ∑ i, X i ω ≥ ε}).toReal ≤ rexp (-(z * ε) + (ε - ↑n * σ ^ 2 * z))
hz : z = log (1 + ε / (↑n * σ ^ 2))
⊢ rexp (-(z * ε) + (ε - ↑n * σ ^ 2 * z)) = rexp (-(↑n * σ ^ 2 * z + ε * z - ε))

Tactic:
apply exp_eq_exp.mpr
    field_simp
    linarith

Tactic state after: