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

tactic: by_contra h
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: 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 μ < ⊤
⊢ False

tactic: have : Memℒp (fun ω => X ω - μ[X]) 2 μ := by
  refine ⟨hXm.sub aestronglyMeasurable_const, ?_⟩
  rw [snorm_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 μ < ⊤
⊢ 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: 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 μ
⊢ 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: convert this.add (memℒp_const <| μ [X])
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: ext ω
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: rw [Pi.add_apply, sub_add_cancel]
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: refine ⟨hXm.sub aestronglyMeasurable_const, ?_⟩
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
⊢ Memℒp (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
⊢ snorm (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ < ⊤

tactic: rw [snorm_eq_lintegral_rpow_nnnorm two_ne_zero ENNReal.two_ne_top]
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
⊢ snorm (fun ω => X ω - ∫ (x : Ω), X x ∂μ) 2 μ < ⊤
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
⊢ (∫⁻ (x : Ω), ↑‖X x - ∫ (x : Ω), X x ∂μ‖₊ ^ ENNReal.toReal 2 ∂μ) ^ (1 / ENNReal.toReal 2) < ⊤

tactic: simp only [ENNReal.toReal_ofNat, ENNReal.one_toReal, ENNReal.rpow_two, Ne]
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
⊢ (∫⁻ (x : Ω), ↑‖X x - ∫ (x : Ω), X x ∂μ‖₊ ^ ENNReal.toReal 2 ∂μ) ^ (1 / ENNReal.toReal 2) < ⊤
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
⊢ (∫⁻ (x : Ω), ↑‖X x - ∫ (x : Ω), X x ∂μ‖₊ ^ 2 ∂μ) ^ (1 / 2) < ⊤

tactic: 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 μ < ⊤
⊢ (∫⁻ (x : Ω), ↑‖X x - ∫ (x : Ω), X x ∂μ‖₊ ^ 2 ∂μ) ^ (1 / 2) < ⊤
state_after: no goals

tactic: linarith
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X : Ω → ℝ
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hXm : AEStronglyMeasurable X μ
hX : ¬Memℒp X 2 μ
h : evariance X μ < ⊤
⊢ 0 ≤ 1 / 2
state_after: no goals