|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Rémy Degenne. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Rémy Degenne |
| 5 | +-/ |
| 6 | +import Mathlib.MeasureTheory.Measure.ProbabilityMeasure |
| 7 | + |
| 8 | +/-! |
| 9 | +# Convergence in distribution |
| 10 | +
|
| 11 | +We introduce a definition of convergence in distribution of random variables: this is the |
| 12 | +weak convergence of the laws of the random variables. In Mathlib terms this is a `Tendsto` in the |
| 13 | +`ProbabilityMeasure` type. |
| 14 | +
|
| 15 | +The definition assumes that the random variables are defined on the same probability space, which |
| 16 | +is the most common setting in applications. Convergence in distribution for random variables |
| 17 | +on different probability spaces can be talked about using the `ProbabilityMeasure` type directly. |
| 18 | +
|
| 19 | +## Main definitions |
| 20 | +
|
| 21 | +* `TendstoInDistribution X l Z μ`: the sequence of random variables `X n` converges in |
| 22 | + distribution to the random variable `Z` along the filter `l` with respect to the probability |
| 23 | + measure `μ`. |
| 24 | +
|
| 25 | +## Main statements |
| 26 | +
|
| 27 | +* `TendstoInDistribution.continuous_comp`: **Continuous mapping theorem**. |
| 28 | + If `X n` tends to `Z` in distribution and `g` is continuous, then `g ∘ X n` tends to `g ∘ Z` |
| 29 | + in distribution. |
| 30 | +-/ |
| 31 | + |
| 32 | +open Filter |
| 33 | +open scoped Topology |
| 34 | + |
| 35 | +namespace MeasureTheory |
| 36 | + |
| 37 | +variable {Ω ι E : Type*} {m : MeasurableSpace Ω} {μ : Measure Ω} [IsProbabilityMeasure μ] |
| 38 | + [TopologicalSpace E] {mE : MeasurableSpace E} {X Y : ι → Ω → E} {Z : Ω → E} {l : Filter ι} |
| 39 | + |
| 40 | +section TendstoInDistribution |
| 41 | + |
| 42 | +/-- Convergence in distribution of random variables. |
| 43 | +This is the weak convergence of the laws of the random variables: `Tendsto` in the |
| 44 | +`ProbabilityMeasure` type. -/ |
| 45 | +structure TendstoInDistribution [OpensMeasurableSpace E] (X : ι → Ω → E) (l : Filter ι) (Z : Ω → E) |
| 46 | + (μ : Measure Ω := by volume_tac) [IsProbabilityMeasure μ] : Prop where |
| 47 | + forall_aemeasurable : ∀ i, AEMeasurable (X i) μ |
| 48 | + aemeasurable_limit : AEMeasurable Z μ := by fun_prop |
| 49 | + tendsto : Tendsto (β := ProbabilityMeasure E) |
| 50 | + (fun n ↦ ⟨μ.map (X n), Measure.isProbabilityMeasure_map (forall_aemeasurable n)⟩) l |
| 51 | + (𝓝 ⟨μ.map Z, Measure.isProbabilityMeasure_map aemeasurable_limit⟩) |
| 52 | + |
| 53 | +lemma tendstoInDistribution_const [OpensMeasurableSpace E] (hZ : AEMeasurable Z μ) : |
| 54 | + TendstoInDistribution (fun _ ↦ Z) l Z μ where |
| 55 | + forall_aemeasurable := fun _ ↦ by fun_prop |
| 56 | + tendsto := tendsto_const_nhds |
| 57 | + |
| 58 | +lemma tendstoInDistribution_unique [HasOuterApproxClosed E] [BorelSpace E] |
| 59 | + (X : ι → Ω → E) {Z W : Ω → E} [l.NeBot] |
| 60 | + (h1 : TendstoInDistribution X l Z μ) (h2 : TendstoInDistribution X l W μ) : |
| 61 | + μ.map Z = μ.map W := by |
| 62 | + have h_eq := tendsto_nhds_unique h1.tendsto h2.tendsto |
| 63 | + rw [Subtype.ext_iff] at h_eq |
| 64 | + simpa using h_eq |
| 65 | + |
| 66 | +/-- **Continuous mapping theorem**: if `X n` tends to `Z` in distribution and `g` is continuous, |
| 67 | +then `g ∘ X n` tends to `g ∘ Z` in distribution. -/ |
| 68 | +theorem TendstoInDistribution.continuous_comp {F : Type*} [OpensMeasurableSpace E] |
| 69 | + [TopologicalSpace F] [MeasurableSpace F] [BorelSpace F] {g : E → F} (hg : Continuous g) |
| 70 | + (h : TendstoInDistribution X l Z μ) : |
| 71 | + TendstoInDistribution (fun n ↦ g ∘ X n) l (g ∘ Z) μ where |
| 72 | + forall_aemeasurable := fun n ↦ hg.measurable.comp_aemeasurable (h.forall_aemeasurable n) |
| 73 | + aemeasurable_limit := hg.measurable.comp_aemeasurable h.aemeasurable_limit |
| 74 | + tendsto := by |
| 75 | + convert ProbabilityMeasure.tendsto_map_of_tendsto_of_continuous _ _ h.tendsto hg |
| 76 | + · simp only [ProbabilityMeasure.map, ProbabilityMeasure.coe_mk, Subtype.mk.injEq] |
| 77 | + rw [AEMeasurable.map_map_of_aemeasurable hg.aemeasurable (h.forall_aemeasurable _)] |
| 78 | + · simp only [ProbabilityMeasure.map, ProbabilityMeasure.coe_mk] |
| 79 | + congr |
| 80 | + rw [AEMeasurable.map_map_of_aemeasurable hg.aemeasurable h.aemeasurable_limit] |
| 81 | + |
| 82 | +end TendstoInDistribution |
| 83 | + |
| 84 | +end MeasureTheory |
0 commit comments