File: Mathlib/Probability/Moments.lean

full_name: ProbabilityTheory.moment
code: /-- Moment of a real random variable, `μ[X ^ p]`. -/
def moment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ 
goal: ℝ

full_name: ProbabilityTheory.centralMoment
code: /-- Central moment of a real random variable, `μ[(X - μ[X]) ^ p]`. -/
def centralMoment (X : Ω → ℝ) (p : ℕ) (μ : Measure Ω) : ℝ 
goal: ℝ

full_name: ProbabilityTheory.moment_zero
code: @[simp]
theorem moment_zero (hp : p ≠ 0) : moment 0 p μ = 0 
goal: ProbabilityTheory.moment 0 p μ = 0

full_name: ProbabilityTheory.centralMoment_zero
code: @[simp]
theorem centralMoment_zero (hp : p ≠ 0) : centralMoment 0 p μ = 0 
goal: ProbabilityTheory.centralMoment 0 p μ = 0

full_name: ProbabilityTheory.centralMoment_one'
code: theorem centralMoment_one' [IsFiniteMeasure μ] (h_int : Integrable X μ) :
    centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * μ[X] 
goal: ProbabilityTheory.centralMoment X 1 μ = (1 - (μ Set.univ).toReal) * ∫ (x : Ω), X x ∂μ

full_name: ProbabilityTheory.centralMoment_one
code: @[simp]
theorem centralMoment_one [IsProbabilityMeasure μ] : centralMoment X 1 μ = 0 
goal: ProbabilityTheory.centralMoment X 1 μ = 0

full_name: ProbabilityTheory.centralMoment_two_eq_variance
code: theorem centralMoment_two_eq_variance [IsFiniteMeasure μ] (hX : Memℒp X 2 μ) :
    centralMoment X 2 μ = variance X μ 
goal: ProbabilityTheory.centralMoment X 2 μ = ProbabilityTheory.variance X μ

full_name: ProbabilityTheory.mgf
code: /-- Moment generating function of a real random variable `X`: `fun t => μ[exp(t*X)]`. -/
def mgf (X : Ω → ℝ) (μ : Measure Ω) (t : ℝ) : ℝ 
goal: ℝ

full_name: ProbabilityTheory.cgf
code: /-- Cumulant generating function of a real random variable `X`: `fun t => log μ[exp(t*X)]`. -/
def cgf (X : Ω → ℝ) (μ : Measure Ω) (t : ℝ) : ℝ 
goal: ℝ

full_name: ProbabilityTheory.mgf_zero_fun
code: @[simp]
theorem mgf_zero_fun : mgf 0 μ t = (μ Set.univ).toReal 
goal: ProbabilityTheory.mgf 0 μ t = (μ Set.univ).toReal

full_name: ProbabilityTheory.cgf_zero_fun
code: @[simp]
theorem cgf_zero_fun : cgf 0 μ t = log (μ Set.univ).toReal 
goal: ProbabilityTheory.cgf 0 μ t = Real.log (μ Set.univ).toReal

full_name: ProbabilityTheory.mgf_zero_measure
code: @[simp]
theorem mgf_zero_measure : mgf X (0 : Measure Ω) t = 0 
goal: ProbabilityTheory.mgf X 0 t = 0

full_name: ProbabilityTheory.cgf_zero_measure
code: @[simp]
theorem cgf_zero_measure : cgf X (0 : Measure Ω) t = 0 
goal: ProbabilityTheory.cgf X 0 t = 0

full_name: ProbabilityTheory.mgf_const'
code: @[simp]
theorem mgf_const' (c : ℝ) : mgf (fun _ => c) μ t = (μ Set.univ).toReal * exp (t * c) 
goal: ProbabilityTheory.mgf (fun x => c) μ t = (μ Set.univ).toReal * rexp (t * c)

full_name: ProbabilityTheory.mgf_const
code: theorem mgf_const (c : ℝ) [IsProbabilityMeasure μ] : mgf (fun _ => c) μ t = exp (t * c) 
goal: ProbabilityTheory.mgf (fun x => c) μ t = rexp (t * c)

full_name: ProbabilityTheory.cgf_const'
code: @[simp]
theorem cgf_const' [IsFiniteMeasure μ] (hμ : μ ≠ 0) (c : ℝ) :
    cgf (fun _ => c) μ t = log (μ Set.univ).toReal + t * c 
goal: ProbabilityTheory.cgf (fun x => c) μ t = Real.log (μ Set.univ).toReal + t * c

full_name: ProbabilityTheory.cgf_const
code: @[simp]
theorem cgf_const [IsProbabilityMeasure μ] (c : ℝ) : cgf (fun _ => c) μ t = t * c 
goal: ProbabilityTheory.cgf (fun x => c) μ t = t * c

full_name: ProbabilityTheory.mgf_zero'
code: @[simp]
theorem mgf_zero' : mgf X μ 0 = (μ Set.univ).toReal 
goal: ProbabilityTheory.mgf X μ 0 = (μ Set.univ).toReal

full_name: ProbabilityTheory.mgf_zero
code: theorem mgf_zero [IsProbabilityMeasure μ] : mgf X μ 0 = 1 
goal: ProbabilityTheory.mgf X μ 0 = 1

full_name: ProbabilityTheory.cgf_zero'
code: @[simp]
theorem cgf_zero' : cgf X μ 0 = log (μ Set.univ).toReal 
goal: ProbabilityTheory.cgf X μ 0 = Real.log (μ Set.univ).toReal

full_name: ProbabilityTheory.cgf_zero
code: theorem cgf_zero [IsProbabilityMeasure μ] : cgf X μ 0 = 0 
goal: ProbabilityTheory.cgf X μ 0 = 0

full_name: ProbabilityTheory.mgf_undef
code: theorem mgf_undef (hX : ¬Integrable (fun ω => exp (t * X ω)) μ) : mgf X μ t = 0 
goal: ProbabilityTheory.mgf X μ t = 0

full_name: ProbabilityTheory.cgf_undef
code: theorem cgf_undef (hX : ¬Integrable (fun ω => exp (t * X ω)) μ) : cgf X μ t = 0 
goal: ProbabilityTheory.cgf X μ t = 0

full_name: ProbabilityTheory.mgf_nonneg
code: theorem mgf_nonneg : 0 ≤ mgf X μ t 
goal: 0 ≤ ProbabilityTheory.mgf X μ t

full_name: ProbabilityTheory.mgf_pos'
code: theorem mgf_pos' (hμ : μ ≠ 0) (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t 
goal: 0 < ProbabilityTheory.mgf X μ t

full_name: ProbabilityTheory.mgf_pos
code: theorem mgf_pos [IsProbabilityMeasure μ] (h_int_X : Integrable (fun ω => exp (t * X ω)) μ) :
    0 < mgf X μ t 
goal: 0 < ProbabilityTheory.mgf X μ t

full_name: ProbabilityTheory.mgf_neg
code: theorem mgf_neg : mgf (-X) μ t = mgf X μ (-t) 
goal: ProbabilityTheory.mgf (-X) μ t = ProbabilityTheory.mgf X μ (-t)

full_name: ProbabilityTheory.cgf_neg
code: theorem cgf_neg : cgf (-X) μ t = cgf X μ (-t) 
goal: ProbabilityTheory.cgf (-X) μ t = ProbabilityTheory.cgf X μ (-t)

full_name: ProbabilityTheory.IndepFun.exp_mul
code: /-- This is a trivial application of `IndepFun.comp` but it will come up frequently. -/
theorem IndepFun.exp_mul {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (s t : ℝ) :
    IndepFun (fun ω => exp (s * X ω)) (fun ω => exp (t * Y ω)) μ 
goal: ProbabilityTheory.IndepFun (fun ω => rexp (s * X ω)) (fun ω => rexp (t * Y ω)) μ

full_name: ProbabilityTheory.IndepFun.mgf_add
code: theorem IndepFun.mgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
    (hX : AEStronglyMeasurable (fun ω => exp (t * X ω)) μ)
    (hY : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
    mgf (X + Y) μ t = mgf X μ t * mgf Y μ t 
goal: ProbabilityTheory.mgf (X + Y) μ t = ProbabilityTheory.mgf X μ t * ProbabilityTheory.mgf Y μ t

full_name: ProbabilityTheory.IndepFun.mgf_add'
code: theorem IndepFun.mgf_add' {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ) (hX : AEStronglyMeasurable X μ)
    (hY : AEStronglyMeasurable Y μ) : mgf (X + Y) μ t = mgf X μ t * mgf Y μ t 
goal: ProbabilityTheory.mgf (X + Y) μ t = ProbabilityTheory.mgf X μ t * ProbabilityTheory.mgf Y μ t

full_name: ProbabilityTheory.IndepFun.cgf_add
code: theorem IndepFun.cgf_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
    (h_int_X : Integrable (fun ω => exp (t * X ω)) μ)
    (h_int_Y : Integrable (fun ω => exp (t * Y ω)) μ) :
    cgf (X + Y) μ t = cgf X μ t + cgf Y μ t 
goal: ProbabilityTheory.cgf (X + Y) μ t = ProbabilityTheory.cgf X μ t + ProbabilityTheory.cgf Y μ t

full_name: ProbabilityTheory.aestronglyMeasurable_exp_mul_add
code: theorem aestronglyMeasurable_exp_mul_add {X Y : Ω → ℝ}
    (h_int_X : AEStronglyMeasurable (fun ω => exp (t * X ω)) μ)
    (h_int_Y : AEStronglyMeasurable (fun ω => exp (t * Y ω)) μ) :
    AEStronglyMeasurable (fun ω => exp (t * (X + Y) ω)) μ 
goal: MeasureTheory.AEStronglyMeasurable (fun ω => rexp (t * (X + Y) ω)) μ

full_name: ProbabilityTheory.aestronglyMeasurable_exp_mul_sum
code: theorem aestronglyMeasurable_exp_mul_sum {X : ι → Ω → ℝ} {s : Finset ι}
    (h_int : ∀ i ∈ s, AEStronglyMeasurable (fun ω => exp (t * X i ω)) μ) :
    AEStronglyMeasurable (fun ω => exp (t * (∑ i ∈ s, X i) ω)) μ 
goal: MeasureTheory.AEStronglyMeasurable (fun ω => rexp (t * (∑ i ∈ s, X i) ω)) μ

full_name: ProbabilityTheory.IndepFun.integrable_exp_mul_add
code: theorem IndepFun.integrable_exp_mul_add {X Y : Ω → ℝ} (h_indep : IndepFun X Y μ)
    (h_int_X : Integrable (fun ω => exp (t * X ω)) μ)
    (h_int_Y : Integrable (fun ω => exp (t * Y ω)) μ) :
    Integrable (fun ω => exp (t * (X + Y) ω)) μ 
goal: MeasureTheory.Integrable (fun ω => rexp (t * (X + Y) ω)) μ

full_name: ProbabilityTheory.iIndepFun.integrable_exp_mul_sum
code: theorem iIndepFun.integrable_exp_mul_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
    (h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
    {s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
    Integrable (fun ω => exp (t * (∑ i ∈ s, X i) ω)) μ 
goal: MeasureTheory.Integrable (fun ω => rexp (t * (∑ i ∈ s, X i) ω)) μ

full_name: ProbabilityTheory.iIndepFun.mgf_sum
code: theorem iIndepFun.mgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
    (h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
    (s : Finset ι) : mgf (∑ i ∈ s, X i) μ t = ∏ i ∈ s, mgf (X i) μ t 
goal: ProbabilityTheory.mgf (∑ i ∈ s, X i) μ t = ∏ i ∈ s, ProbabilityTheory.mgf (X i) μ t

full_name: ProbabilityTheory.iIndepFun.cgf_sum
code: theorem iIndepFun.cgf_sum [IsProbabilityMeasure μ] {X : ι → Ω → ℝ}
    (h_indep : iIndepFun (fun i => inferInstance) X μ) (h_meas : ∀ i, Measurable (X i))
    {s : Finset ι} (h_int : ∀ i ∈ s, Integrable (fun ω => exp (t * X i ω)) μ) :
    cgf (∑ i ∈ s, X i) μ t = ∑ i ∈ s, cgf (X i) μ t 
goal: ProbabilityTheory.cgf (∑ i ∈ s, X i) μ t = ∑ i ∈ s, ProbabilityTheory.cgf (X i) μ t

full_name: ProbabilityTheory.measure_ge_le_exp_mul_mgf
code: /-- **Chernoff bound** on the upper tail of a real random variable. -/
theorem measure_ge_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
    (h_int : Integrable (fun ω => exp (t * X ω)) μ) :
    (μ {ω | ε ≤ X ω}).toReal ≤ exp (-t * ε) * mgf X μ t 
goal: (μ {ω | ε ≤ X ω}).toReal ≤ rexp (-t * ε) * ProbabilityTheory.mgf X μ t

full_name: ProbabilityTheory.measure_le_le_exp_mul_mgf
code: /-- **Chernoff bound** on the lower tail of a real random variable. -/
theorem measure_le_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
    (h_int : Integrable (fun ω => exp (t * X ω)) μ) :
    (μ {ω | X ω ≤ ε}).toReal ≤ exp (-t * ε) * mgf X μ t 
goal: (μ {ω | X ω ≤ ε}).toReal ≤ rexp (-t * ε) * ProbabilityTheory.mgf X μ t

full_name: ProbabilityTheory.measure_ge_le_exp_cgf
code: /-- **Chernoff bound** on the upper tail of a real random variable. -/
theorem measure_ge_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : 0 ≤ t)
    (h_int : Integrable (fun ω => exp (t * X ω)) μ) :
    (μ {ω | ε ≤ X ω}).toReal ≤ exp (-t * ε + cgf X μ t) 
goal: (μ {ω | ε ≤ X ω}).toReal ≤ rexp (-t * ε + ProbabilityTheory.cgf X μ t)

full_name: ProbabilityTheory.measure_le_le_exp_cgf
code: /-- **Chernoff bound** on the lower tail of a real random variable. -/
theorem measure_le_le_exp_cgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
    (h_int : Integrable (fun ω => exp (t * X ω)) μ) :
    (μ {ω | X ω ≤ ε}).toReal ≤ exp (-t * ε + cgf X μ t) 
goal: (μ {ω | X ω ≤ ε}).toReal ≤ rexp (-t * ε + ProbabilityTheory.cgf X μ t)