Theorem: ProbabilityTheory.evariance_def'
File: Mathlib/Probability/Variance.lean

tactic: by_cases hℒ : Memℒp X 2
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
⊢ evariance X ℙ = (∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2)
state_after: case pos
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
⊢ evariance X ℙ = (∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2)

case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : ¬Memℒp X 2 ℙ
⊢ evariance X ℙ = (∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2)

tactic: rw [← hℒ.ofReal_variance_eq, variance_def' hℒ, ENNReal.ofReal_sub _ (sq_nonneg _)]
state_before: case pos
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
⊢ evariance X ℙ = (∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2)
state_after: case pos
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
⊢ ENNReal.ofReal (∫ (a : Ω), (X ^ 2) a) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2) =
    (∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2)

tactic: congr
state_before: case pos
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
⊢ ENNReal.ofReal (∫ (a : Ω), (X ^ 2) a) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2) =
    (∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2)
state_after: case pos.e_a
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
⊢ ENNReal.ofReal (∫ (a : Ω), (X ^ 2) a) = ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)

tactic: rw [lintegral_coe_eq_integral]
state_before: case pos.e_a
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
⊢ ENNReal.ofReal (∫ (a : Ω), (X ^ 2) a) = ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)
state_after: case pos.e_a
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
⊢ ENNReal.ofReal (∫ (a : Ω), (X ^ 2) a) = ENNReal.ofReal (∫ (a : Ω), ↑(‖X a‖₊ ^ 2))

case pos.e_a.hfi
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
⊢ Integrable (fun x => ↑(‖X x‖₊ ^ 2)) ℙ

tactic: congr 2 with ω
state_before: case pos.e_a
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
⊢ ENNReal.ofReal (∫ (a : Ω), (X ^ 2) a) = ENNReal.ofReal (∫ (a : Ω), ↑(‖X a‖₊ ^ 2))
state_after: case pos.e_a.e_r.e_f.h
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
ω : Ω
⊢ (X ^ 2) ω = ↑(‖X ω‖₊ ^ 2)

tactic: simp only [Pi.pow_apply, NNReal.coe_pow, coe_nnnorm, Real.norm_eq_abs, Even.pow_abs even_two]
state_before: case pos.e_a.e_r.e_f.h
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
ω : Ω
⊢ (X ^ 2) ω = ↑(‖X ω‖₊ ^ 2)
state_after: no goals

tactic: exact hℒ.abs.integrable_sq
state_before: case pos.e_a.hfi
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : Memℒp X 2 ℙ
⊢ Integrable (fun x => ↑(‖X x‖₊ ^ 2)) ℙ
state_after: no goals

tactic: symm
state_before: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : ¬Memℒp X 2 ℙ
⊢ evariance X ℙ = (∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2)
state_after: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : ¬Memℒp X 2 ℙ
⊢ (∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2) = evariance X ℙ

tactic: rw [evariance_eq_top hX hℒ, ENNReal.sub_eq_top_iff]
state_before: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : ¬Memℒp X 2 ℙ
⊢ (∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2)) - ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2) = evariance X ℙ
state_after: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : ¬Memℒp X 2 ℙ
⊢ ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2) = ⊤ ∧ ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2) ≠ ⊤

tactic: refine ⟨?_, ENNReal.ofReal_ne_top⟩
state_before: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : ¬Memℒp X 2 ℙ
⊢ ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2) = ⊤ ∧ ENNReal.ofReal ((∫ (a : Ω), X a) ^ 2) ≠ ⊤
state_after: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : ¬Memℒp X 2 ℙ
⊢ ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2) = ⊤

tactic: rw [Memℒp, not_and] at hℒ
state_before: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : ¬Memℒp X 2 ℙ
⊢ ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2) = ⊤
state_after: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : AEStronglyMeasurable X ℙ → ¬snorm X 2 ℙ < ⊤
⊢ ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2) = ⊤

tactic: specialize hℒ hX
state_before: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : AEStronglyMeasurable X ℙ → ¬snorm X 2 ℙ < ⊤
⊢ ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2) = ⊤
state_after: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : ¬snorm X 2 ℙ < ⊤
⊢ ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2) = ⊤

tactic: simp only [snorm_eq_lintegral_rpow_nnnorm two_ne_zero ENNReal.two_ne_top, not_lt, top_le_iff,
  ENNReal.toReal_ofNat, one_div, ENNReal.rpow_eq_top_iff, inv_lt_zero, inv_pos, and_true_iff,
  or_iff_not_imp_left, not_and_or, zero_lt_two] at hℒ
state_before: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : ¬snorm X 2 ℙ < ⊤
⊢ ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2) = ⊤
state_after: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : (¬¬∫⁻ (x : Ω), ↑‖X x‖₊ ^ 2 = 0 → 0 ≤ 2) → ∫⁻ (x : Ω), ↑‖X x‖₊ ^ 2 = ⊤
⊢ ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2) = ⊤

tactic: exact mod_cast hℒ fun _ => zero_le_two
state_before: case neg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
X : Ω → ℝ
hX : AEStronglyMeasurable X ℙ
hℒ : (¬¬∫⁻ (x : Ω), ↑‖X x‖₊ ^ 2 = 0 → 0 ≤ 2) → ∫⁻ (x : Ω), ↑‖X x‖₊ ^ 2 = ⊤
⊢ ∫⁻ (ω : Ω), ↑(‖X ω‖₊ ^ 2) = ⊤
state_after: no goals