Theorem: ProbabilityTheory.evariance_eq_top
File: Mathlib/Probability/Variance.lean

Proof steps:
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
⊢ evariance X μ = ⊤
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : ¬evariance X μ = ⊤
⊢ False
tactic: by_contra h
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : ¬evariance X μ = ⊤
⊢ False
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
⊢ False
tactic: rw [← Ne, ← lt_top_iff_ne_top] at h
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
⊢ False
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
this : Memℒp (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ
⊢ False
tactic: have : Memℒp (fun ω => X ω - μ[X]) 2 μ := by
    refine ⟨hXm.sub aestronglyMeasurable_const, ?_⟩
    rw [eLpNorm_eq_lintegral_rpow_nnnorm two_ne_zero ENNReal.two_ne_top]
    simp only [ENNReal.toReal_ofNat, ENNReal.one_toReal, ENNReal.rpow_two, Ne]
    exact ENNReal.rpow_lt_top_of_nonneg (by linarith) h.ne
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
this : Memℒp (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ
⊢ False
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
this : Memℒp (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ
⊢ Memℒp X 2 μ
tactic: refine hX ?_
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
this : Memℒp (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ
⊢ Memℒp X 2 μ
state_after: case h.e'_5
Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
this : Memℒp (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ
⊢ X = (fun ω => X ω - ∫ (x : Ω), X x ∂μ) + fun x => ∫ (x : Ω), X x ∂μ
tactic: convert this.add (memℒp_const <| μ [X])
state_before: case h.e'_5
Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
this : Memℒp (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ
⊢ X = (fun ω => X ω - ∫ (x : Ω), X x ∂μ) + fun x => ∫ (x : Ω), X x ∂μ
state_after: case h.e'_5.h
Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
this : Memℒp (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ
ω : Ω
⊢ X ω = ((fun ω => X ω - ∫ (x : Ω), X x ∂μ) + fun x => ∫ (x : Ω), X x ∂μ) ω
tactic: ext ω
state_before: case h.e'_5.h
Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
this : Memℒp (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ
ω : Ω
⊢ X ω = ((fun ω => X ω - ∫ (x : Ω), X x ∂μ) + fun x => ∫ (x : Ω), X x ∂μ) ω
state_after: no goals
tactic: rw [Pi.add_apply, sub_add_cancel]