Theorem: ProbabilityTheory.centralMoment_one
File: Mathlib/Probability/Moments.lean

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

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

tactic: rw [centralMoment_one' h_int]
state_before: case pos
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : Integrable X μ
⊢ centralMoment X 1 μ = 0
state_after: case pos
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : Integrable X μ
⊢ (1 - (μ Set.univ).toReal) * ∫ (x : Ω), X x ∂μ = 0

tactic: simp only [measure_univ, ENNReal.one_toReal, sub_self, zero_mul]
state_before: case pos
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : Integrable X μ
⊢ (1 - (μ Set.univ).toReal) * ∫ (x : Ω), X x ∂μ = 0
state_after: no goals

tactic: simp only [centralMoment, Pi.sub_apply, pow_one]
state_before: case neg
Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X μ
⊢ centralMoment X 1 μ = 0
state_after: 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

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 _)
state_before: 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
state_after: 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

tactic: rw [integral_undef this]
state_before: 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
state_after: no goals

tactic: refine fun h_sub => h_int ?_
state_before: Ω : Type u_1
ι : Type u_2
m : MeasurableSpace Ω
X : Ω → ℝ
p : ℕ
μ : Measure Ω
inst✝ : IsProbabilityMeasure μ
h_int : ¬Integrable X μ
⊢ ¬Integrable (fun x => X x - integral μ X) μ
state_after: Ω : 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 μ

tactic: have h_add : X = (fun x => X x - integral μ X) + fun _ => integral μ X := by ext1 x; simp
state_before: Ω : 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 μ
state_after: Ω : 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 μ

tactic: rw [h_add]
state_before: Ω : 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 μ
state_after: Ω : 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) μ

tactic: exact h_sub.add (integrable_const _)
state_before: Ω : 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) μ
state_after: no goals

tactic: ext1 x
state_before: Ω : 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
state_after: 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

tactic: simp
state_before: 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
state_after: no goals