zzhisthebest/LeanBenchmark huggingface dataset:
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

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

Tactic state before:
case h_diff
Ω : 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
ω : Ω
x : ℝ
a✝ : x ∈ Metric.ball t (|t| + 1)
⊢ HasDerivAt (fun x => rexp (x * X ω)) (rexp (x * X ω) * X ω) x

Tactic:
exact HasDerivAt.exp (hasDerivAt_mul_const (X ω))

Tactic state after:
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_93.{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 (t * X ω)‖ ≤ ‖rexp (|t| * c)‖ → t * X ω ≤ |t| * 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‖
ω : Ω
h : X ω ∈ Set.Icc a b
⊢ ‖rexp (t * X ω)‖ ≤ ‖rexp (|t| * c)‖

Tactic:
simp only [norm_eq_abs, abs_exp, exp_le_exp]

Tactic state after:
[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‖
 ω : Ω
 h : X ω ∈ Set.Icc a b
 ⊢ t * X ω ≤ |t| * c]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_94.{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 → t * X ω ≤ |t| * c → t * X ω ≤ |t| * |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‖
ω : Ω
h : X ω ∈ Set.Icc a b
⊢ t * X ω ≤ |t| * c

Tactic:
rw [← (abs_eq_self.mpr (le_trans' (le_max_left |a| ‖b‖) (abs_nonneg a)) : |c| = c)]

Tactic state after:
[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‖
 ω : Ω
 h : X ω ∈ Set.Icc a b
 ⊢ t * X ω ≤ |t| * |c|]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

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

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

Tactic:
apply integral_congr_ae

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


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_96.{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 :
    ((∂μ.tilted fun ω => t * X ω/∂μ) ω).toReal • f (X ω) = (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ) * f (X ω)) :
  (ENNReal.ofReal (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ)).toReal • f (X ω) =
    (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ) * f (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) ∂μ)
⊢ ((∂μ.tilted fun ω => t * X ω/∂μ) ω).toReal • f (X ω) = (rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ) * f (X ω)

Tactic:
rw [w]

Tactic state after:
[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 ω)]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_97.{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) ∂μ ∨ f (X ω) = 0 := 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]

Tactic state after:
[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) ∂μ)
 ⊢ 0 ≤ rexp (t * X ω) / ∫ (x : Ω), rexp (t * X x) ∂μ ∨ f (X ω) = 0]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

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

Tactic state before:
Ω : 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) ∂μ)
⊢ 0 ≤ ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ

Tactic:
apply integral_nonneg

Tactic state after:
[case hf
 Ω : 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) ∂μ)
 ⊢ 0 ≤ fun ω => rexp (t * X ω)]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

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

Tactic state before:
case hf
Ω : 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) ∂μ)
⊢ 0 ≤ fun ω => rexp (t * X ω)

Tactic:
apply Pi.le_def.mpr _

Tactic state after:
[Ω : 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) ∂μ)
 ⊢ ∀ (i : Ω), 0 i ≤ rexp (t * X i)]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

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

Tactic state before:
Ω : 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) ∂μ)
i : Ω
⊢ 0 i ≤ rexp (t * X i)

Tactic:
simp only [Pi.zero_apply]

Tactic state after:
[Ω : 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) ∂μ)
 i : Ω
 ⊢ 0 ≤ rexp (t * X i)]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

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

Tactic state before:
Ω : 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) ∂μ)
i : Ω
⊢ 0 ≤ rexp (t * X i)

Tactic:
exact exp_nonneg (t * X i)

Tactic state after:
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_102.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] (t : ℝ) {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) ∂μ := sorry

Tactic state before:
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) ∂μ

Tactic:
exact div_nonneg (exp_nonneg (t * X ω)) q2

Tactic state after:
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_103.{u_1} {Ω : Type u_1} {m : MeasurableSpace Ω} {μ : Measure Ω}
  [inst : IsFiniteMeasure μ] (t : ℝ) (f : ℝ → ℝ) {X : Ω → ℝ} (hX : AEMeasurable X μ) (a : Ω)
  (h_original_goal :
    (fun ω => (rexp (t * X ω) / ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ) * f (X ω)) a =
      (fun ω => rexp (t * X ω) * f (X ω) / ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ) a) :
  (rexp (t * X a) / ∫ (x : Ω), rexp (t * X x) ∂μ) * f (X a) =
    rexp (t * X a) * f (X a) / ∫ (x : Ω), rexp (t * X x) ∂μ := sorry

Tactic state before:
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
t : ℝ
f : ℝ → ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
a : Ω
⊢ (fun ω => (rexp (t * X ω) / ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ) * f (X ω)) a =
    (fun ω => rexp (t * X ω) * f (X ω) / ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ) a

Tactic:
simp only

Tactic state after:
[Ω : Type u_1
 m : MeasurableSpace Ω
 μ : Measure Ω
 inst✝ : IsFiniteMeasure μ
 t : ℝ
 f : ℝ → ℝ
 X : Ω → ℝ
 hX : AEMeasurable X μ
 a : Ω
 ⊢ (rexp (t * X a) / ∫ (x : Ω), rexp (t * X x) ∂μ) * f (X a) = rexp (t * X a) * f (X a) / ∫ (x : Ω), rexp (t * X x) ∂μ]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_104.{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 : Ω), X x ∂μ.tilted fun ω => t * X ω) = (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ →
      HasDerivAt f (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) t →
        HasDerivAt f ((∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X 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 : Ω), X x ∂μ.tilted fun ω => t * X ω) = (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ
⊢ HasDerivAt f (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) t

Tactic:
rw [r0]

Tactic state after:
[Ω : 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 : Ω), X x ∂μ.tilted fun ω => t * X ω) = (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ
 ⊢ HasDerivAt f ((∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ) t]
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_105.{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 : Ω), X x ∂μ.tilted fun ω => t * X ω) = (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ →
      HasDerivAt f ((∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X 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 : Ω), X x ∂μ.tilted fun ω => t * X ω) = (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ
⊢ HasDerivAt f ((∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ) t

Tactic:
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 FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_106.{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) (t : ℝ) :
  (∫ (x : Ω), (fun ω => id (X ω)) x ∂μ.tilted fun ω => t * X ω) =
    (∫ (x : Ω), (fun ω => rexp (t * X ω) * id (X ω)) x ∂μ) / ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ := sorry

Tactic state before:
case h
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
inst✝¹ : IsFiniteMeasure μ
inst✝ : NeZero μ
a b : ℝ
X : Ω → ℝ
hX : AEMeasurable X μ
h : ∀ᵐ (ω : Ω) ∂μ, X ω ∈ Set.Icc a b
g' : ℝ → ℝ := fun t => ∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω
g'' : ℝ → ℝ :=
  fun t => (∫ (x : Ω), (X ^ 2) x ∂μ.tilted fun ω => t * X ω) - (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) ^ 2
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 ∂μ

Tactic:
exact integral_tilted t id hX

Tactic state after:
import Mathlib
import FoML


open MeasureTheory Filter Finset Real

open scoped MeasureTheory ProbabilityTheory ENNReal NNReal

theorem extracted_formal_statement_109.{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) (t : ℝ)
  (r0 :
    (fun t => ∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) = fun t =>
      (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ)
  (r01 :
    (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) = (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ)
  (r0' :
    (∫ (x : Ω), X x ^ 2 ∂μ.tilted fun ω => t * X ω) =
      (∫ (x : Ω), rexp (t * X x) * X x ^ 2 ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ) :
  ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ ≠ 0 := 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
g' : ℝ → ℝ := fun t => ∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω
g'' : ℝ → ℝ :=
  fun t => (∫ (x : Ω), (X ^ 2) x ∂μ.tilted fun ω => t * X ω) - (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) ^ 2
t : ℝ
r0 :
  (fun t => ∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) = fun t =>
    (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ
r01 : (∫ (x : Ω), X x ∂μ.tilted fun ω => t * X ω) = (∫ (x : Ω), rexp (t * X x) * X x ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ
r0' :
  (∫ (x : Ω), X x ^ 2 ∂μ.tilted fun ω => t * X ω) =
    (∫ (x : Ω), rexp (t * X x) * X x ^ 2 ∂μ) / ∫ (x : Ω), rexp (t * X x) ∂μ
⊢ ∫ (x : Ω), (fun ω => rexp (t * X ω)) x ∂μ ≠ 0

Tactic:
exact (mgf_pos' (NeZero.ne μ) (integrable_expt_bound hX h)).ne'

Tactic state after: