Zulip Chat Archive

Stream: mathlib4

Topic: Advice on proving theorem on sum of random variables


David Ledvinka (Mar 17 2025 at 03:26):

I would like to contribute to Mathlib by proving that if XX and YY are two independent random variables with pdfs pp and qq then the pdf of X+YX + Y is the convolution pqp * q (In particular I would like to prove the identity for the sum of independent Gaussians). The most general and natural way I would think of doing this would be to prove:

For a monoid "MM":

  1. If XμX \sim \mu and YνY \sim \nu are independent random variables taking values in MM then the distribution of XYXY is given by the convolution of μ\mu with ν\nu.

For a group "GG":

  1. If λ\lambda is a (left/right) invariant measure on GG and μ,ν\mu,\nu are measures on GG with densities f,gf,g w.r.t λ\lambda respectively, then the convolution of μ\mu with ν\nu has density given by the convolution of ff and gg with respect to λ\lambda (appropriately defined).

Trying to come up with a statement for 2 I ran into some issues and figured I should ask for advice. Two of the main issues arise from the definition of convolution of functions in mathlib which do not allow for the group to be non-commutative and do not allow for the domain to be the extended reals (or extended non-negative reals). I could still use this definition by dropping some level of generality but even then I find a statement of 2 quite unwieldy because for example you need to take in f,g:G[0,)f,g : G \to [0,\infty), convert them to G[0,]G \to [0,\infty] so they can be turned into densities, convert them to GRG \to \R so that you can take a convolution, and then convert the output back to G[0,]G \to [0,\infty] so it can again be converted into a density. Perhaps this could be all resolved by defining a convolution on functions G[0,]G \to [0,\infty] but perhaps this would lead to too much confusion / proof duplication from the other notion of convolution and I am not sure if this is a good idea? Perhaps there is a better way to resolve this issue?

David Ledvinka (Mar 17 2025 at 10:58):

I wrote up this proof of "Step 1". Would love some feedback on the proof structure since I read all of MIL but noticed that many of the proofs in Mathlib look nothing like the proofs in MIL (featuring heavy use of simp etc...)

/- Imports -/
import Mathlib.MeasureTheory.Group.Convolution
import Mathlib.Probability.Independence.Basic

open MeasureTheory ProbabilityTheory Measure AEMeasurable
--open scoped ENNReal

section indepFun

@[to_additive]
theorem IndepFun.map_mul_eq_conv_map_map {M : Type*} [Monoid M] [MeasurableSpace M]
    [MeasurableMul₂ M] {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ]
    {f : Ω  M} {g : Ω  M} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) (hfg : IndepFun f g μ):
    μ.map (f * g) = (μ.map f)  (μ.map g) := by
  have : f * g = (fun (x,y)  x * y)  (fun ω  (f ω, g ω)) := by rfl
  rw[this,  map_map_of_aemeasurable measurable_mul.aemeasurable (AEMeasurable.prodMk hf hg),
     (indepFun_iff_map_prod_eq_prod_map_map hf hg).mp hfg]
  rfl

end indepFun

Etienne Marion (Mar 17 2025 at 11:26):

Because we have docs#MeasureTheory.lintegral for ENNReal-valued functions and docs#MeasureTheory.integral for NormedAddCommGroup-valued functions, I think it would make sense to define MeasureTheory.lconvolution.


Last updated: May 02 2025 at 03:31 UTC