l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem centralMoment_zero (hp : p ≠ 0) : centralMoment 0 p μ = 0 := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
hp : p ≠ 0
⊢ centralMoment 0 p μ = 0

Next tactic:
simp only [centralMoment, hp, Pi.zero_apply, integral_const, smul_eq_mul,
    mul_zero, zero_sub, Pi.pow_apply, Pi.neg_apply, neg_zero, zero_pow', Ne.def, not_false_iff]
theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
    centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * μ[X] := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
h_int : Integrable X
⊢ centralMoment X 1 μ = (1 - ENNReal.toReal (↑↑μ Set.univ)) * ∫ (x : Ω), X x ∂μ

Next tactic:
simp only [centralMoment, Pi.sub_apply, pow_one]
theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
    centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * μ[X] := by
  simp only [centralMoment, Pi.sub_apply, pow_one]
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
h_int : Integrable X
⊢ ∫ (x : Ω), X x - ∫ (x : Ω), X x ∂μ ∂μ = (1 - ENNReal.toReal (↑↑μ Set.univ)) * ∫ (x : Ω), X x ∂μ

Next tactic:
rw [integral_sub h_int (integrable_const _)]
theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
    centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * μ[X] := by
  simp only [centralMoment, Pi.sub_apply, pow_one]
  rw [integral_sub h_int (integrable_const _)]
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
h_int : Integrable X
⊢ ∫ (a : Ω), X a ∂μ - ∫ (a : Ω), ∫ (x : Ω), X x ∂μ ∂μ = (1 - ENNReal.toReal (↑↑μ Set.univ)) * ∫ (x : Ω), X x ∂μ

Next tactic:
simp only [sub_mul, integral_const, smul_eq_mul, one_mul]
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
⊢ centralMoment X 1 μ = 0

Next tactic:
by_cases h_int : Integrable X μ
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · 

Proof state:
case pos
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : Integrable X
⊢ centralMoment X 1 μ = 0

Next tactic:
rw [centralMoment_one' h_int]
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · rw [centralMoment_one' h_int]
    

Proof state:
case pos
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : Integrable X
⊢ (1 - ENNReal.toReal (↑↑μ Set.univ)) * ∫ (x : Ω), X x ∂μ = 0

Next tactic:
simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · rw [centralMoment_one' h_int]
    simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
  · 

Proof state:
case neg
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X
⊢ centralMoment X 1 μ = 0

Next tactic:
simp only [centralMoment, Pi.sub_apply, pow_one]
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · rw [centralMoment_one' h_int]
    simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
  · simp only [centralMoment, Pi.sub_apply, pow_one]
    

Proof state:
case neg
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X
⊢ ∫ (x : Ω), X x - ∫ (x : Ω), X x ∂μ ∂μ = 0

Next tactic:
have : ¬Integrable (fun x => X x - integral μ X) μ := by
      refine' fun h_sub => h_int _
      have h_add : X = (fun x => X x - integral μ X) + fun _ => integral μ X := by ext1 x; simp
      rw [h_add]
      exact h_sub.add (integrable_const _)
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · rw [centralMoment_one' h_int]
    simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
  · simp only [centralMoment, Pi.sub_apply, pow_one]
    have : ¬Integrable (fun x => X x - integral μ X) μ := by
      

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X
⊢ ¬Integrable fun x => X x - integral μ X

Next tactic:
refine' fun h_sub => h_int _
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · rw [centralMoment_one' h_int]
    simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
  · simp only [centralMoment, Pi.sub_apply, pow_one]
    have : ¬Integrable (fun x => X x - integral μ X) μ := by
      refine' fun h_sub => h_int _
      

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X
h_sub : Integrable fun x => X x - integral μ X
⊢ Integrable X

Next tactic:
have h_add : X = (fun x => X x - integral μ X) + fun _ => integral μ X := by ext1 x; simp
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · rw [centralMoment_one' h_int]
    simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
  · simp only [centralMoment, Pi.sub_apply, pow_one]
    have : ¬Integrable (fun x => X x - integral μ X) μ := by
      refine' fun h_sub => h_int _
      have h_add : X = (fun x => X x - integral μ X) + fun _ => integral μ X := by 

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X
h_sub : Integrable fun x => X x - integral μ X
⊢ X = (fun x => X x - integral μ X) + fun x => integral μ X

Next tactic:
ext1 x
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · rw [centralMoment_one' h_int]
    simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
  · simp only [centralMoment, Pi.sub_apply, pow_one]
    have : ¬Integrable (fun x => X x - integral μ X) μ := by
      refine' fun h_sub => h_int _
      have h_add : X = (fun x => X x - integral μ X) + fun _ => integral μ X := by ext1 x; 

Proof state:
case h
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X
h_sub : Integrable fun x => X x - integral μ X
x : Ω
⊢ X x = ((fun x => X x - integral μ X) + fun x => integral μ X) x

Next tactic:
simp
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · rw [centralMoment_one' h_int]
    simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
  · simp only [centralMoment, Pi.sub_apply, pow_one]
    have : ¬Integrable (fun x => X x - integral μ X) μ := by
      refine' fun h_sub => h_int _
      have h_add : X = (fun x => X x - integral μ X) + fun _ => integral μ X := by ext1 x; simp
      

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X
h_sub : Integrable fun x => X x - integral μ X
h_add : X = (fun x => X x - integral μ X) + fun x => integral μ X
⊢ Integrable X

Next tactic:
rw [h_add]
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · rw [centralMoment_one' h_int]
    simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
  · simp only [centralMoment, Pi.sub_apply, pow_one]
    have : ¬Integrable (fun x => X x - integral μ X) μ := by
      refine' fun h_sub => h_int _
      have h_add : X = (fun x => X x - integral μ X) + fun _ => integral μ X := by ext1 x; simp
      rw [h_add]
      

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X
h_sub : Integrable fun x => X x - integral μ X
h_add : X = (fun x => X x - integral μ X) + fun x => integral μ X
⊢ Integrable ((fun x => X x - integral μ X) + fun x => integral μ X)

Next tactic:
exact h_sub.add (integrable_const _)
@[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 := by
  by_cases h_int : Integrable X μ
  · rw [centralMoment_one' h_int]
    simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
  · simp only [centralMoment, Pi.sub_apply, pow_one]
    have : ¬Integrable (fun x => X x - integral μ X) μ := by
      refine' fun h_sub => h_int _
      have h_add : X = (fun x => X x - integral μ X) + fun _ => integral μ X := by ext1 x; simp
      rw [h_add]
      exact h_sub.add (integrable_const _)
    

Proof state:
case neg
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X
this : ¬Integrable fun x => X x - integral μ X
⊢ ∫ (x : Ω), X x - ∫ (x : Ω), X x ∂μ ∂μ = 0

Next tactic:
rw [integral_undef this]
theorem centralMoment_two_eq_variance [IsFiniteMeasure μ] (hX : Memℒp X 2 μ) :
    centralMoment X 2 μ = variance X μ := by 

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hX : Memℒp X 2
⊢ centralMoment X 2 μ = variance X μ

Next tactic:
rw [hX.variance_eq]
theorem centralMoment_two_eq_variance [IsFiniteMeasure μ] (hX : Memℒp X 2 μ) :
    centralMoment X 2 μ = variance X μ := by rw [hX.variance_eq]; 

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hX : Memℒp X 2
⊢ centralMoment X 2 μ = ∫ (x : Ω), ((X - fun x => ∫ (x : Ω), X x ∂μ) ^ 2) x ∂μ

Next tactic:
rfl
@[simp]
theorem mgf_zero_fun : mgf 0 μ t = (μ Set.univ).toReal := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
⊢ mgf 0 μ t = ENNReal.toReal (↑↑μ Set.univ)

Next tactic:
simp only [mgf, Pi.zero_apply, mul_zero, exp_zero, integral_const, smul_eq_mul, mul_one]
@[simp]
theorem cgf_zero_fun : cgf 0 μ t = log (μ Set.univ).toReal := by 

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
⊢ cgf 0 μ t = log (ENNReal.toReal (↑↑μ Set.univ))

Next tactic:
simp only [cgf, mgf_zero_fun]
@[simp]
theorem mgf_zero_measure : mgf X (0 : Measure Ω) t = 0 := by 

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
⊢ mgf X 0 t = 0

Next tactic:
simp only [mgf, integral_zero_measure]
@[simp]
theorem cgf_zero_measure : cgf X (0 : Measure Ω) t = 0 := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
⊢ cgf X 0 t = 0

Next tactic:
simp only [cgf, log_zero, mgf_zero_measure]
@[simp]
theorem mgf_const' (c : ℝ) : mgf (fun _ => c) μ t = (μ Set.univ).toReal * exp (t * c) := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t c : ℝ
⊢ mgf (fun x => c) μ t = ENNReal.toReal (↑↑μ Set.univ) * rexp (t * c)

Next tactic:
simp only [mgf, integral_const, smul_eq_mul]
theorem mgf_const (c : ℝ) [IsProbabilityMeasure μ] : mgf (fun _ => c) μ t = exp (t * c) := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t c : ℝ
inst✝ : IsProbabilityMeasure μ
⊢ mgf (fun x => c) μ t = rexp (t * c)

Next tactic:
simp only [mgf_const', measure_univ, ENNReal.one_toReal, one_mul]
@[simp]
theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
    cgf (fun _ => c) μ t = log (μ Set.univ).toReal + t * c := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
inst✝ : IsFiniteMeasure μ
hμ : μ ≠ 0
c : ℝ
⊢ cgf (fun x => c) μ t = log (ENNReal.toReal (↑↑μ Set.univ)) + t * c

Next tactic:
simp only [cgf, mgf_const']
@[simp]
theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
    cgf (fun _ => c) μ t = log (μ Set.univ).toReal + t * c := by
  simp only [cgf, mgf_const']
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
inst✝ : IsFiniteMeasure μ
hμ : μ ≠ 0
c : ℝ
⊢ log (ENNReal.toReal (↑↑μ Set.univ) * rexp (t * c)) = log (ENNReal.toReal (↑↑μ Set.univ)) + t * c

Next tactic:
rw [log_mul _ (exp_pos _).ne']
@[simp]
theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
    cgf (fun _ => c) μ t = log (μ Set.univ).toReal + t * c := by
  simp only [cgf, mgf_const']
  rw [log_mul _ (exp_pos _).ne']
  · 

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
inst✝ : IsFiniteMeasure μ
hμ : μ ≠ 0
c : ℝ
⊢ log (ENNReal.toReal (↑↑μ Set.univ)) + log (rexp (t * c)) = log (ENNReal.toReal (↑↑μ Set.univ)) + t * c

Next tactic:
rw [log_exp _]
@[simp]
theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
    cgf (fun _ => c) μ t = log (μ Set.univ).toReal + t * c := by
  simp only [cgf, mgf_const']
  rw [log_mul _ (exp_pos _).ne']
  · rw [log_exp _]
  · 

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
inst✝ : IsFiniteMeasure μ
hμ : μ ≠ 0
c : ℝ
⊢ ENNReal.toReal (↑↑μ Set.univ) ≠ 0

Next tactic:
rw [Ne.def, ENNReal.toReal_eq_zero_iff, Measure.measure_univ_eq_zero]
@[simp]
theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
    cgf (fun _ => c) μ t = log (μ Set.univ).toReal + t * c := by
  simp only [cgf, mgf_const']
  rw [log_mul _ (exp_pos _).ne']
  · rw [log_exp _]
  · rw [Ne.def, ENNReal.toReal_eq_zero_iff, Measure.measure_univ_eq_zero]
    

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
inst✝ : IsFiniteMeasure μ
hμ : μ ≠ 0
c : ℝ
⊢ ¬(μ = 0 ∨ ↑↑μ Set.univ = ⊤)

Next tactic:
simp only [hμ, measure_ne_top μ Set.univ, or_self_iff, not_false_iff]
@[simp]
theorem cgf_const [IsProbabilityMeasure μ] (c : ℝ) : cgf (fun _ => c) μ t = t * c := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
inst✝ : IsProbabilityMeasure μ
c : ℝ
⊢ cgf (fun x => c) μ t = t * c

Next tactic:
simp only [cgf, mgf_const, log_exp]
@[simp]
theorem mgf_zero' : mgf X μ 0 = (μ Set.univ).toReal := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
⊢ mgf X μ 0 = ENNReal.toReal (↑↑μ Set.univ)

Next tactic:
simp only [mgf, zero_mul, exp_zero, integral_const, smul_eq_mul, mul_one]
theorem mgf_zero [IsProbabilityMeasure μ] : mgf X μ 0 = 1 := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
inst✝ : IsProbabilityMeasure μ
⊢ mgf X μ 0 = 1

Next tactic:
simp only [mgf_zero', measure_univ, ENNReal.one_toReal]
@[simp]
theorem cgf_zero' : cgf X μ 0 = log (μ Set.univ).toReal := by 

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
⊢ cgf X μ 0 = log (ENNReal.toReal (↑↑μ Set.univ))

Next tactic:
simp only [cgf, mgf_zero']
theorem cgf_zero [IsProbabilityMeasure μ] : cgf X μ 0 = 0 := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
inst✝ : IsProbabilityMeasure μ
⊢ cgf X μ 0 = 0

Next tactic:
simp only [cgf_zero', measure_univ, ENNReal.one_toReal, log_one]
theorem mgf_undef (hX : ¬Integrable (fun ω => exp (t * X ω)) μ) : mgf X μ t = 0 := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hX : ¬Integrable fun ω => rexp (t * X ω)
⊢ mgf X μ t = 0

Next tactic:
simp only [mgf, integral_undef hX]
theorem cgf_undef (hX : ¬Integrable (fun ω => exp (t * X ω)) μ) : cgf X μ t = 0 := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hX : ¬Integrable fun ω => rexp (t * X ω)
⊢ cgf X μ t = 0

Next tactic:
simp only [cgf, mgf_undef hX, log_zero]
theorem mgf_nonneg : 0 ≤ mgf X μ t := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
⊢ 0 ≤ mgf X μ t

Next tactic:
refine' integral_nonneg _
theorem mgf_nonneg : 0 ≤ mgf X μ t := by
  refine' integral_nonneg _
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
⊢ 0 ≤ fun x => (fun ω => rexp (t * X ω)) x

Next tactic:
intro ω
theorem mgf_nonneg : 0 ≤ mgf X μ t := by
  refine' integral_nonneg _
  intro ω
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
ω : Ω
⊢ OfNat.ofNat 0 ω ≤ (fun x => (fun ω => rexp (t * X ω)) x) ω

Next tactic:
simp only [Pi.zero_apply]
theorem mgf_nonneg : 0 ≤ mgf X μ t := by
  refine' integral_nonneg _
  intro ω
  simp only [Pi.zero_apply]
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
ω : Ω
⊢ 0 ≤ rexp (t * X ω)

Next tactic:
exact (exp_pos _).le
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hμ : μ ≠ 0
h_int_X : Integrable fun ω => rexp (t * X ω)
⊢ 0 < mgf X μ t

Next tactic:
simp_rw [mgf]
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t := by
  simp_rw [mgf]
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hμ : μ ≠ 0
h_int_X : Integrable fun ω => rexp (t * X ω)
⊢ 0 < ∫ (x : Ω), rexp (t * X x) ∂μ

Next tactic:
have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
    simp only [Measure.restrict_univ]
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t := by
  simp_rw [mgf]
  have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
    

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hμ : μ ≠ 0
h_int_X : Integrable fun ω => rexp (t * X ω)
⊢ ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ

Next tactic:
simp only [Measure.restrict_univ]
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t := by
  simp_rw [mgf]
  have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
    simp only [Measure.restrict_univ]
  

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hμ : μ ≠ 0
h_int_X : Integrable fun ω => rexp (t * X ω)
this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ
⊢ 0 < ∫ (x : Ω), rexp (t * X x) ∂μ

Next tactic:
rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _]
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t := by
  simp_rw [mgf]
  have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
    simp only [Measure.restrict_univ]
  rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _]
  · 

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hμ : μ ≠ 0
h_int_X : Integrable fun ω => rexp (t * X ω)
this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ
⊢ 0 < ↑↑μ ((Function.support fun x => rexp (t * X x)) ∩ Set.univ)

Next tactic:
have h_eq_univ : (Function.support fun x : Ω => exp (t * X x)) = Set.univ := by
      ext1 x
      simp only [Function.mem_support, Set.mem_univ, iff_true_iff]
      exact (exp_pos _).ne'
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t := by
  simp_rw [mgf]
  have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
    simp only [Measure.restrict_univ]
  rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _]
  · have h_eq_univ : (Function.support fun x : Ω => exp (t * X x)) = Set.univ := by
      

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hμ : μ ≠ 0
h_int_X : Integrable fun ω => rexp (t * X ω)
this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ
⊢ (Function.support fun x => rexp (t * X x)) = Set.univ

Next tactic:
ext1 x
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t := by
  simp_rw [mgf]
  have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
    simp only [Measure.restrict_univ]
  rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _]
  · have h_eq_univ : (Function.support fun x : Ω => exp (t * X x)) = Set.univ := by
      ext1 x
      

Proof state:
case h
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hμ : μ ≠ 0
h_int_X : Integrable fun ω => rexp (t * X ω)
this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ
x : Ω
⊢ (x ∈ Function.support fun x => rexp (t * X x)) ↔ x ∈ Set.univ

Next tactic:
simp only [Function.mem_support, Set.mem_univ, iff_true_iff]
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t := by
  simp_rw [mgf]
  have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
    simp only [Measure.restrict_univ]
  rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _]
  · have h_eq_univ : (Function.support fun x : Ω => exp (t * X x)) = Set.univ := by
      ext1 x
      simp only [Function.mem_support, Set.mem_univ, iff_true_iff]
      

Proof state:
case h
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hμ : μ ≠ 0
h_int_X : Integrable fun ω => rexp (t * X ω)
this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ
x : Ω
⊢ rexp (t * X x) ≠ 0

Next tactic:
exact (exp_pos _).ne'
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t := by
  simp_rw [mgf]
  have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
    simp only [Measure.restrict_univ]
  rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _]
  · have h_eq_univ : (Function.support fun x : Ω => exp (t * X x)) = Set.univ := by
      ext1 x
      simp only [Function.mem_support, Set.mem_univ, iff_true_iff]
      exact (exp_pos _).ne'
    

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hμ : μ ≠ 0
h_int_X : Integrable fun ω => rexp (t * X ω)
this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ
h_eq_univ : (Function.support fun x => rexp (t * X x)) = Set.univ
⊢ 0 < ↑↑μ ((Function.support fun x => rexp (t * X x)) ∩ Set.univ)

Next tactic:
rw [h_eq_univ, Set.inter_univ _]
theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t := by
  simp_rw [mgf]
  have : ∫ x : Ω, exp (t * X x) ∂μ = ∫ x : Ω in Set.univ, exp (t * X x) ∂μ := by
    simp only [Measure.restrict_univ]
  rw [this, set_integral_pos_iff_support_of_nonneg_ae _ _]
  · have h_eq_univ : (Function.support fun x : Ω => exp (t * X x)) = Set.univ := by
      ext1 x
      simp only [Function.mem_support, Set.mem_univ, iff_true_iff]
      exact (exp_pos _).ne'
    rw [h_eq_univ, Set.inter_univ _]
    

Proof state:
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
t : ℝ
hμ : μ ≠ 0
h_int_X : Integrable fun ω => rexp (t * X ω)
this : ∫ (x : Ω), rexp (t * X x) ∂μ = ∫ (x : Ω) in Set.univ, rexp (t * X x) ∂μ
h_eq_univ : (Function.support fun x => rexp (t * X x)) = Set.univ
⊢ 0 < ↑↑μ Set.univ

Next tactic:
refine' Ne.bot_lt _