Skip to content

Commit b924256

Browse files
committed
feat: variance of a sum with respect to the product measure (#36039)
1 parent affdc91 commit b924256

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Mathlib/Probability/Moments/Variance.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,21 @@ nonrec theorem IndepFun.variance_sum {ι : Type*} {X : ι → Ω → ℝ} {s : F
425425
refine Finset.sum_eq_single_of_mem i hi fun j hj1 hj2 ↦ ?_
426426
exact (h hi hj1 hj2.symm).covariance_eq_zero (hs i hi) (hs j hj1)
427427

428+
lemma variance_sum_pi [Fintype ι] {Ω : ι → Type*} {mΩ : ∀ i, MeasurableSpace (Ω i)}
429+
{μ : (i : ι) → Measure (Ω i)} [∀ i, IsProbabilityMeasure (μ i)]
430+
{X : Π i, Ω i → ℝ} (h : ∀ i, MemLp (X i) 2 (μ i)) :
431+
Var[∑ i, fun ω ↦ X i (ω i); Measure.pi μ] = ∑ i, Var[X i; μ i] := by
432+
rw [IndepFun.variance_sum]
433+
· congr with i
434+
change Var[(X i) ∘ (fun ω ↦ ω i); Measure.pi μ] = _
435+
rw [← variance_map, (measurePreserving_eval _ i).map_eq]
436+
· rw [(measurePreserving_eval _ i).map_eq]
437+
exact (h i).aestronglyMeasurable.aemeasurable
438+
· exact Measurable.aemeasurable (by fun_prop)
439+
· exact fun i _ ↦ (h i).comp_measurePreserving (measurePreserving_eval _ i)
440+
· exact fun i _ j _ hij ↦
441+
(iIndepFun_pi fun i ↦ (h i).aestronglyMeasurable.aemeasurable).indepFun hij
442+
428443
/-- **The Bhatia-Davis inequality on variance**
429444
430445
The variance of a random variable `X` satisfying `a ≤ X ≤ b` almost everywhere is at most

0 commit comments

Comments
 (0)