Theorem: ProbabilityTheory.IndepFun.variance_sum
File: Mathlib/Probability/Variance.lean

tactic: induction' s using Finset.induction_on with k s ks IH
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
s : Finset ι
hs : ∀ i ∈ s, Memℒp (X i) 2 ℙ
h : (↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
state_after: case empty
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
hs : ∀ i ∈ ∅, Memℒp (X i) 2 ℙ
h : (↑∅).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ variance (∑ i ∈ ∅, X i) ℙ = ∑ i ∈ ∅, variance (X i) ℙ

case insert
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ variance (∑ i ∈ insert k s, X i) ℙ = ∑ i ∈ insert k s, variance (X i) ℙ

tactic: rw [variance_def' (memℒp_finset_sum' _ hs), sum_insert ks, sum_insert ks]
state_before: case insert
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ variance (∑ i ∈ insert k s, X i) ℙ = ∑ i ∈ insert k s, variance (X i) ℙ
state_after: case insert
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (∫ (a : Ω), ((X k + ∑ x ∈ s, X x) ^ 2) a) - (∫ (a : Ω), (X k + ∑ x ∈ s, X x) a) ^ 2 =
    variance (X k) ℙ + ∑ x ∈ s, variance (X x) ℙ

tactic: simp only [add_sq']
state_before: case insert
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (∫ (a : Ω), ((X k + ∑ x ∈ s, X x) ^ 2) a) - (∫ (a : Ω), (X k + ∑ x ∈ s, X x) a) ^ 2 =
    variance (X k) ℙ + ∑ x ∈ s, variance (X x) ℙ
state_after: case insert
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (∫ (a : Ω), (X k ^ 2 + (∑ x ∈ s, X x) ^ 2 + 2 * X k * ∑ x ∈ s, X x) a) - (∫ (a : Ω), (X k + ∑ x ∈ s, X x) a) ^ 2 =
    variance (X k) ℙ + ∑ x ∈ s, variance (X x) ℙ

tactic: simp only [Finset.sum_empty, variance_zero]
state_before: case empty
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
hs : ∀ i ∈ ∅, Memℒp (X i) 2 ℙ
h : (↑∅).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ variance (∑ i ∈ ∅, X i) ℙ = ∑ i ∈ ∅, variance (X i) ℙ
state_after: no goals

tactic: rw [integral_add', integral_add', integral_add']
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (∫ (a : Ω), (X k ^ 2 + (∑ i ∈ s, X i) ^ 2 + 2 * X k * ∑ i ∈ s, X i) a) - (∫ (a : Ω), (X k + ∑ i ∈ s, X i) a) ^ 2 =
    (((∫ (a : Ω), (X k ^ 2) a) + ∫ (a : Ω), ((∑ i ∈ s, X i) ^ 2) a) + ∫ (a : Ω), (2 * X k * ∑ i ∈ s, X i) a) -
      ((∫ (a : Ω), X k a) + ∫ (a : Ω), (∑ i ∈ s, X i) a) ^ 2
state_after: case hf
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (X k) ℙ

case hg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (∑ i ∈ s, X i) ℙ

case hf
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (X k ^ 2) ℙ

case hg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable ((∑ i ∈ s, X i) ^ 2) ℙ

case hf
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (X k ^ 2 + (∑ i ∈ s, X i) ^ 2) ℙ

case hg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (2 * X k * ∑ i ∈ s, X i) ℙ

tactic: exact Memℒp.integrable one_le_two (hs _ (mem_insert_self _ _))
state_before: case hf
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (X k) ℙ
state_after: no goals

tactic: apply integrable_finset_sum' _ fun i hi => ?_
state_before: case hg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (∑ i ∈ s, X i) ℙ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ Integrable (X i) ℙ

tactic: exact Memℒp.integrable one_le_two (hs _ (mem_insert_of_mem hi))
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ Integrable (X i) ℙ
state_after: no goals

tactic: exact Memℒp.integrable_sq (hs _ (mem_insert_self _ _))
state_before: case hf
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (X k ^ 2) ℙ
state_after: no goals

tactic: apply Memℒp.integrable_sq
state_before: case hg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable ((∑ i ∈ s, X i) ^ 2) ℙ
state_after: case hg.h
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Memℒp (∑ i ∈ s, X i) 2 ℙ

tactic: exact memℒp_finset_sum' _ fun i hi => hs _ (mem_insert_of_mem hi)
state_before: case hg.h
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Memℒp (∑ i ∈ s, X i) 2 ℙ
state_after: no goals

tactic: apply Integrable.add
state_before: case hf
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (X k ^ 2 + (∑ i ∈ s, X i) ^ 2) ℙ
state_after: case hf.hf
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (X k ^ 2) ℙ

case hf.hg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable ((∑ i ∈ s, X i) ^ 2) ℙ

tactic: exact Memℒp.integrable_sq (hs _ (mem_insert_self _ _))
state_before: case hf.hf
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (X k ^ 2) ℙ
state_after: no goals

tactic: apply Memℒp.integrable_sq
state_before: case hf.hg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable ((∑ i ∈ s, X i) ^ 2) ℙ
state_after: case hf.hg.h
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Memℒp (∑ i ∈ s, X i) 2 ℙ

tactic: exact memℒp_finset_sum' _ fun i hi => hs _ (mem_insert_of_mem hi)
state_before: case hf.hg.h
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Memℒp (∑ i ∈ s, X i) 2 ℙ
state_after: no goals

tactic: rw [mul_assoc]
state_before: case hg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (2 * X k * ∑ i ∈ s, X i) ℙ
state_after: case hg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (2 * (X k * ∑ i ∈ s, X i)) ℙ

tactic: apply Integrable.const_mul _ (2 : ℝ)
state_before: case hg
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (2 * (X k * ∑ i ∈ s, X i)) ℙ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (X k * ∑ i ∈ s, X i) ℙ

tactic: rw [mul_sum, sum_fn]
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (X k * ∑ i ∈ s, X i) ℙ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (fun a => ∑ c ∈ s, (X k * X c) a) ℙ

tactic: apply integrable_finset_sum _ fun i hi => ?_
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ Integrable (fun a => ∑ c ∈ s, (X k * X c) a) ℙ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ Integrable (X k * X i) ℙ

tactic: apply IndepFun.integrable_mul _ (Memℒp.integrable one_le_two (hs _ (mem_insert_self _ _)))
  (Memℒp.integrable one_le_two (hs _ (mem_insert_of_mem hi)))
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ Integrable (X k * X i) ℙ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ IndepFun (X k) (X i) ℙ

tactic: apply h (mem_insert_self _ _) (mem_insert_of_mem hi)
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ IndepFun (X k) (X i) ℙ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ k ≠ i

tactic: exact fun hki => ks (hki.symm ▸ hi)
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ k ≠ i
state_after: no goals

tactic: rw [variance_def' (hs _ (mem_insert_self _ _)),
  variance_def' (memℒp_finset_sum' _ fun i hi => hs _ (mem_insert_of_mem hi))]
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (((∫ (a : Ω), (X k ^ 2) a) + ∫ (a : Ω), ((∑ i ∈ s, X i) ^ 2) a) + ∫ (a : Ω), (2 * X k * ∑ i ∈ s, X i) a) -
      ((∫ (a : Ω), X k a) + ∫ (a : Ω), (∑ i ∈ s, X i) a) ^ 2 =
    variance (X k) ℙ + variance (∑ i ∈ s, X i) ℙ +
      ((∫ (a : Ω), (2 * X k * ∑ i ∈ s, X i) a) - (2 * ∫ (a : Ω), X k a) * ∫ (a : Ω), (∑ i ∈ s, X i) a)
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (((∫ (a : Ω), (X k ^ 2) a) + ∫ (a : Ω), ((∑ i ∈ s, X i) ^ 2) a) + ∫ (a : Ω), (2 * X k * ∑ i ∈ s, X i) a) -
      ((∫ (a : Ω), X k a) + ∫ (a : Ω), (∑ i ∈ s, X i) a) ^ 2 =
    (∫ (a : Ω), (X k ^ 2) a) - (∫ (a : Ω), X k a) ^ 2 +
        ((∫ (a : Ω), ((∑ i ∈ s, X i) ^ 2) a) - (∫ (a : Ω), (∑ i ∈ s, X i) a) ^ 2) +
      ((∫ (a : Ω), (2 * X k * ∑ i ∈ s, X i) a) - (2 * ∫ (a : Ω), X k a) * ∫ (a : Ω), (∑ i ∈ s, X i) a)

tactic: ring
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (((∫ (a : Ω), (X k ^ 2) a) + ∫ (a : Ω), ((∑ i ∈ s, X i) ^ 2) a) + ∫ (a : Ω), (2 * X k * ∑ i ∈ s, X i) a) -
      ((∫ (a : Ω), X k a) + ∫ (a : Ω), (∑ i ∈ s, X i) a) ^ 2 =
    (∫ (a : Ω), (X k ^ 2) a) - (∫ (a : Ω), X k a) ^ 2 +
        ((∫ (a : Ω), ((∑ i ∈ s, X i) ^ 2) a) - (∫ (a : Ω), (∑ i ∈ s, X i) a) ^ 2) +
      ((∫ (a : Ω), (2 * X k * ∑ i ∈ s, X i) a) - (2 * ∫ (a : Ω), X k a) * ∫ (a : Ω), (∑ i ∈ s, X i) a)
state_after: no goals

tactic: simp_rw [Pi.mul_apply, Pi.ofNat_apply, Nat.cast_ofNat, sum_apply, mul_sum, mul_assoc,
  add_right_eq_self]
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ variance (X k) ℙ + variance (∑ i ∈ s, X i) ℙ +
      ((∫ (a : Ω), (2 * X k * ∑ i ∈ s, X i) a) - (2 * ∫ (a : Ω), X k a) * ∫ (a : Ω), (∑ i ∈ s, X i) a) =
    variance (X k) ℙ + variance (∑ i ∈ s, X i) ℙ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (∫ (a : Ω), ∑ x ∈ s, 2 * (X k a * X x a)) - 2 * ((∫ (a : Ω), X k a) * ∫ (a : Ω), ∑ c ∈ s, X c a) = 0

tactic: rw [integral_finset_sum s fun i hi => ?_]
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (∫ (a : Ω), ∑ x ∈ s, 2 * (X k a * X x a)) - 2 * ((∫ (a : Ω), X k a) * ∫ (a : Ω), ∑ c ∈ s, X c a) = 0
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (∑ i ∈ s, ∫ (a : Ω), 2 * (X k a * X i a)) - 2 * ((∫ (a : Ω), X k a) * ∫ (a : Ω), ∑ c ∈ s, X c a) = 0

Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ Integrable (fun a => 2 * (X k a * X i a)) ℙ

tactic: swap
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (∑ i ∈ s, ∫ (a : Ω), 2 * (X k a * X i a)) - 2 * ((∫ (a : Ω), X k a) * ∫ (a : Ω), ∑ c ∈ s, X c a) = 0

Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ Integrable (fun a => 2 * (X k a * X i a)) ℙ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ Integrable (fun a => 2 * (X k a * X i a)) ℙ

Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (∑ i ∈ s, ∫ (a : Ω), 2 * (X k a * X i a)) - 2 * ((∫ (a : Ω), X k a) * ∫ (a : Ω), ∑ c ∈ s, X c a) = 0

tactic: rw [integral_finset_sum s fun i hi =>
    Memℒp.integrable one_le_two (hs _ (mem_insert_of_mem hi)),
  mul_sum, mul_sum, ← sum_sub_distrib]
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ (∑ i ∈ s, ∫ (a : Ω), 2 * (X k a * X i a)) - 2 * ((∫ (a : Ω), X k a) * ∫ (a : Ω), ∑ c ∈ s, X c a) = 0
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ ∑ x ∈ s, ((∫ (a : Ω), 2 * (X k a * X x a)) - 2 * ((∫ (a : Ω), X k a) * ∫ (a : Ω), X x a)) = 0

tactic: apply Finset.sum_eq_zero fun i hi => ?_
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ ∑ x ∈ s, ((∫ (a : Ω), 2 * (X k a * X x a)) - 2 * ((∫ (a : Ω), X k a) * ∫ (a : Ω), X x a)) = 0
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ (∫ (a : Ω), 2 * (X k a * X i a)) - 2 * ((∫ (a : Ω), X k a) * ∫ (a : Ω), X i a) = 0

tactic: rw [integral_mul_left, IndepFun.integral_mul', sub_self]
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ (∫ (a : Ω), 2 * (X k a * X i a)) - 2 * ((∫ (a : Ω), X k a) * ∫ (a : Ω), X i a) = 0
state_after: case hXY
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ IndepFun (X k) (X i) ℙ

case hX
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ AEStronglyMeasurable (X k) ℙ

case hY
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ AEStronglyMeasurable (X i) ℙ

tactic: apply Integrable.const_mul _ (2 : ℝ)
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ Integrable (fun a => 2 * (X k a * X i a)) ℙ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ Integrable (fun x => X k x * X i x) ℙ

tactic: apply IndepFun.integrable_mul _ (Memℒp.integrable one_le_two (hs _ (mem_insert_self _ _)))
  (Memℒp.integrable one_le_two (hs _ (mem_insert_of_mem hi)))
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ Integrable (fun x => X k x * X i x) ℙ
state_after: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ IndepFun (X k) (X i) ℙ

tactic: apply h (mem_insert_self _ _) (mem_insert_of_mem hi)
state_before: case hXY
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ IndepFun (X k) (X i) ℙ
state_after: case hXY
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ k ≠ i

tactic: exact fun hki => ks (hki.symm ▸ hi)
state_before: case hXY
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ k ≠ i
state_after: no goals

tactic: exact Memℒp.aestronglyMeasurable (hs _ (mem_insert_self _ _))
state_before: case hX
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ AEStronglyMeasurable (X k) ℙ
state_after: no goals

tactic: exact Memℒp.aestronglyMeasurable (hs _ (mem_insert_of_mem hi))
state_before: case hY
Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
i : ι
hi : i ∈ s
⊢ AEStronglyMeasurable (X i) ℙ
state_after: no goals

tactic: rw [IH (fun i hi => hs i (mem_insert_of_mem hi))
    (h.mono (by simp only [coe_insert, Set.subset_insert]))]
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ variance (X k) ℙ + variance (∑ i ∈ s, X i) ℙ = variance (X k) ℙ + ∑ i ∈ s, variance (X i) ℙ
state_after: no goals

tactic: simp only [coe_insert, Set.subset_insert]
state_before: Ω : Type u_1
m : MeasurableSpace Ω
X✝ : Ω → ℝ
μ : Measure Ω
inst✝¹ : MeasureSpace Ω
inst✝ : IsProbabilityMeasure ℙ
ι : Type u_2
X : ι → Ω → ℝ
k : ι
s : Finset ι
ks : k ∉ s
IH :
  (∀ i ∈ s, Memℒp (X i) 2 ℙ) →
    ((↑s).Pairwise fun i j => IndepFun (X i) (X j) ℙ) → variance (∑ i ∈ s, X i) ℙ = ∑ i ∈ s, variance (X i) ℙ
hs : ∀ i ∈ insert k s, Memℒp (X i) 2 ℙ
h : (↑(insert k s)).Pairwise fun i j => IndepFun (X i) (X j) ℙ
⊢ ↑s ⊆ ↑(insert k s)
state_after: no goals