@@ -9,10 +9,13 @@ import Mathlib.Probability.Independence.Basic
99/-!
1010# Independence of stochastic processes
1111
12+ We prove that a stochastic process $(X_s)_{s \in S}$ is independent from a random variable $Y$ if
13+ for all $s_1, ..., s_p \in S$ the family $(X_{s_1}, ..., X_{s_p})$ is independent from $Y$.
14+
1215We prove that two stochastic processes $(X_s)_{s \in S}$ and $(Y_t)_{t \in T}$ are independent if
1316for all $s_1, ..., s_p \in S$ and $t_1, ..., t_q \in T$ the two families
14- $(X_{s_1}, ..., X_{s_p})$ and $(Y_{t_1}, ..., Y_{t_q})$ are independent. We prove an analogous
15- condition for a family of stochastic processes.
17+ $(X_{s_1}, ..., X_{s_p})$ and $(Y_{t_1}, ..., Y_{t_q})$ are independent.
18+ We prove an analogous condition for a family of stochastic processes.
1619
1720## Tags
1821
@@ -29,15 +32,14 @@ namespace Kernel
2932
3033variable {Ξ± : Type *} {mΞ± : MeasurableSpace Ξ±} {ΞΊ : Kernel Ξ± Ξ©} {P : Measure Ξ±}
3134
32- /-- Two stochastic processes $(X_s)_{s \in S}$ and $(Y_t)_{t \in T}$ are independent if
33- for all $s_1, ..., s_p \in S$ and $t_1, ..., t_q \in T$ the two families
34- $(X_{s_1}, ..., X_{s_p})$ and $(Y_{t_1}, ..., Y_{t_q})$ are independent. -/
35- lemma IndepFun.indepFun_process {T : Type *} {π§ : S β Type *} {π¨ : T β Type *}
36- [β i, MeasurableSpace (π§ i)] [β j, MeasurableSpace (π¨ j)] {X : (i : S) β Ξ© β π§ i}
37- {Y : (j : T) β Ξ© β π¨ j} (hX : β i, Measurable (X i)) (hY : β j, Measurable (Y j))
38- (h : β (I : Finset S) (J : Finset T),
39- IndepFun (fun Ο (i : I) β¦ X i Ο) (fun Ο (j : J) β¦ Y j Ο) ΞΊ P) [IsZeroOrMarkovKernel ΞΊ] :
40- IndepFun (fun Ο i β¦ X i Ο) (fun Ο j β¦ Y j Ο) ΞΊ P := by
35+ /-- A stochastic process $(X_s)_{s \in S}$ is independent from a random variable $Y$ if
36+ for all $s_1, ..., s_p \in S$ the family $(X_{s_1}, ..., X_{s_p})$ is independent from $Y$. -/
37+ lemma IndepFun.process_indepFun {π§ : S β Type *} {π¨ : Type *}
38+ [β i, MeasurableSpace (π§ i)] [MeasurableSpace π¨] {X : (i : S) β Ξ© β π§ i}
39+ {Y : Ξ© β π¨} (hX : β i, Measurable (X i)) (hY : Measurable Y)
40+ (h : β (I : Finset S),
41+ IndepFun (fun Ο (i : I) β¦ X i Ο) Y ΞΊ P) [IsZeroOrMarkovKernel ΞΊ] :
42+ IndepFun (fun Ο i β¦ X i Ο) Y ΞΊ P := by
4143 -- The Ο-system obtained by pulling back the Ο-system of square cylinders by `X`.
4244 let ΟX := {s : Set Ξ© | β t β squareCylinders (fun i β¦ {s : Set (π§ i) | MeasurableSet s}),
4345 (fun Ο i β¦ X i Ο) β»ΒΉ' t = s}
@@ -46,30 +48,43 @@ lemma IndepFun.indepFun_process {T : Type*} {π§ : S β Type*} {π¨ : T β T
4648 have ΟX_gen : (MeasurableSpace.pi.comap fun Ο i β¦ X i Ο) = generateFrom ΟX := by
4749 rw [generateFrom_squareCylinders.symm, MeasurableSpace.comap_generateFrom]
4850 rfl
49- -- The Ο-system obtained by pulling back the Ο-system of square cylinders by `Y`.
50- let ΟY := {s : Set Ξ© | β t β squareCylinders (fun j β¦ {s : Set (π¨ j) | MeasurableSet s}),
51- (fun Ο j β¦ Y j Ο) β»ΒΉ' t = s}
52- have ΟY_pi : IsPiSystem ΟY :=
53- IsPiSystem.comap (isPiSystem_squareCylinders (fun _ β¦ isPiSystem_measurableSet) (by simp)) _
54- have ΟY_gen : (MeasurableSpace.pi.comap fun Ο j β¦ Y j Ο) = generateFrom ΟY := by
55- rw [generateFrom_squareCylinders.symm, MeasurableSpace.comap_generateFrom]
56- rfl
57- -- To prove independence, we prove independence of the generating Ο-systems.
58- refine IndepSets.indep (measurable_pi_iff.2 hX).comap_le (measurable_pi_iff.2 hY).comap_le
59- ΟX_pi ΟY_pi ΟX_gen ΟY_gen ?_
60- rintro - - β¨-, β¨I, s, hs, rflβ©, rflβ© β¨-, β¨J, t, ht, rflβ©, rflβ©
61- simp only [Set.mem_pi, Set.mem_univ, Set.mem_setOf_eq, forall_const] at hs ht
62- have : (fun Ο i β¦ X i Ο) β»ΒΉ' .pi I s β© (fun Ο j β¦ Y j Ο) β»ΒΉ' .pi J t =
63- (fun Ο (i : I) β¦ X i Ο) β»ΒΉ' .pi (SetLike.coe Finset.univ) (fun i β¦ s i) β©
64- (fun Ο (j : J) β¦ Y j Ο) β»ΒΉ' .pi (SetLike.coe Finset.univ) (fun j β¦ t j) := by
51+ -- To prove independence, we prove independence of the generating Ο-system with the `Ο`-alebra.
52+ refine IndepSets.indep (measurable_pi_iff.2 hX).comap_le hY.comap_le
53+ ΟX_pi (@isPiSystem_measurableSet Ξ© (.comap Y inferInstance)) ΟX_gen
54+ (@generateFrom_measurableSet Ξ© (.comap Y inferInstance)).symm ?_
55+ rintro - - β¨-, β¨I, s, hs, rflβ©, rflβ© β¨t, ht, rflβ©
56+ simp only [Set.mem_pi, Set.mem_univ, Set.mem_setOf_eq, forall_const] at hs
57+ have : (fun Ο i β¦ X i Ο) β»ΒΉ' .pi I s =
58+ (fun Ο (i : I) β¦ X i Ο) β»ΒΉ' .pi (SetLike.coe Finset.univ) (fun i β¦ s i)
59+ := by
6560 ext; simp
6661 have h1 : MeasurableSet <| .pi (SetLike.coe Finset.univ) (fun (i : I) β¦ s i) :=
6762 .pi (Finset.countable_toSet _) (fun _ _ β¦ hs _)
68- have h2 : MeasurableSet <| .pi (SetLike.coe Finset.univ) (fun (j : J) β¦ t j) :=
69- .pi (Finset.countable_toSet _) (fun _ _ β¦ ht _)
70- filter_upwards [(h I J).measure_inter_preimage_eq_mul _ _ h1 h2] with Ο hΟ
63+ filter_upwards [(h I).measure_inter_preimage_eq_mul _ _ h1 ht] with Ο hΟ
7164 rw [this, hΟ]
72- congr 2 <;> ext <;> simp
65+
66+ /-- A random variable $X$ is independent from a stochastic process $(Y_s)_{s \in S}$ if
67+ for all $s_1, ..., s_p \in S$ the variable $Y$ is independent from the family
68+ $(X_{s_1}, ..., X_{s_p})$. -/
69+ lemma IndepFun.indepFun_process {π§ : Type *} {π¨ : S β Type *}
70+ [MeasurableSpace π§] [β i, MeasurableSpace (π¨ i)] {X : Ξ© β π§}
71+ {Y : (i : S) β Ξ© β π¨ i} (hX : Measurable X) (hY : β i, Measurable (Y i))
72+ (h : β (I : Finset S),
73+ IndepFun X (fun Ο (i : I) β¦ Y i Ο) ΞΊ P) [IsZeroOrMarkovKernel ΞΊ] :
74+ IndepFun X (fun Ο i β¦ Y i Ο) ΞΊ P :=
75+ (IndepFun.process_indepFun hY hX (fun I β¦ (h I).symm)).symm
76+
77+ /-- Two stochastic processes $(X_s)_{s \in S}$ and $(Y_t)_{t \in T}$ are independent if
78+ for all $s_1, ..., s_p \in S$ and $t_1, ..., t_q \in T$ the two families
79+ $(X_{s_1}, ..., X_{s_p})$ and $(Y_{t_1}, ..., Y_{t_q})$ are independent. -/
80+ lemma IndepFun.process_indepFun_process {T : Type *} {π§ : S β Type *} {π¨ : T β Type *}
81+ [β i, MeasurableSpace (π§ i)] [β j, MeasurableSpace (π¨ j)] {X : (i : S) β Ξ© β π§ i}
82+ {Y : (j : T) β Ξ© β π¨ j} (hX : β i, Measurable (X i)) (hY : β j, Measurable (Y j))
83+ (h : β (I : Finset S) (J : Finset T),
84+ IndepFun (fun Ο (i : I) β¦ X i Ο) (fun Ο (j : J) β¦ Y j Ο) ΞΊ P) [IsZeroOrMarkovKernel ΞΊ] :
85+ IndepFun (fun Ο i β¦ X i Ο) (fun Ο j β¦ Y j Ο) ΞΊ P := by
86+ refine IndepFun.process_indepFun hX (measurable_pi_lambda _ hY) fun I β¦ ?_
87+ exact IndepFun.indepFun_process (measurable_pi_lambda _ fun _ β¦ hX _) hY fun J β¦ h I J
7388
7489/-- Stochastic processes $((X^s_t)_{t \in T_s})_{s \in S}$ are mutually independent if
7590for all $s_1, ..., s_n$ and all $t^{s_i}_1, ..., t^{s_i}_{p_i}^ the families
@@ -117,16 +132,41 @@ end Kernel
117132
118133variable {P : Measure Ξ©}
119134
135+ /-- A stochastic process $(X_s)_{s \in S}$ is independent from a random variable $Y$ if
136+ for all $s_1, ..., s_p \in S$ the family $(X_{s_1}, ..., X_{s_p})$ is independent from $Y$. -/
137+ lemma IndepFun.process_indepFun {π§ : S β Type *} {π¨ : Type *}
138+ [β i, MeasurableSpace (π§ i)] [MeasurableSpace π¨] {X : (i : S) β Ξ© β π§ i}
139+ {Y : Ξ© β π¨} (hX : β i, Measurable (X i)) (hY : AEMeasurable Y P)
140+ (h : β (I : Finset S),
141+ IndepFun (fun Ο (i : I) β¦ X i Ο) Y P) [IsZeroOrProbabilityMeasure P] :
142+ IndepFun (fun Ο i β¦ X i Ο) Y P := by
143+ suffices (fun Ο i β¦ X i Ο) βα΅’[P] (hY.mk Y) from
144+ this.congr .rfl hY.ae_eq_mk.symm
145+ exact Kernel.IndepFun.process_indepFun hX hY.measurable_mk (fun I β¦ (h I).congr .rfl hY.ae_eq_mk)
146+
147+ /-- A random variable $X$ is independent from a stochastic process $(Y_s)_{s \in S}$ if
148+ for all $s_1, ..., s_p \in S$ the variable $Y$ is independent from the family
149+ $(X_{s_1}, ..., X_{s_p})$. -/
150+ lemma IndepFun.indepFun_process {π§ : Type *} {π¨ : S β Type *}
151+ [MeasurableSpace π§] [β i, MeasurableSpace (π¨ i)] {X : Ξ© β π§}
152+ {Y : (i : S) β Ξ© β π¨ i} (hX : AEMeasurable X P) (hY : β i, Measurable (Y i))
153+ (h : β (I : Finset S),
154+ IndepFun X (fun Ο (i : I) β¦ Y i Ο) P) [IsZeroOrProbabilityMeasure P] :
155+ IndepFun X (fun Ο i β¦ Y i Ο) P := by
156+ suffices (hX.mk X) βα΅’[P] (fun Ο i β¦ Y i Ο) from
157+ this.congr hX.ae_eq_mk.symm .rfl
158+ exact Kernel.IndepFun.indepFun_process hX.measurable_mk hY (fun I β¦ (h I).congr hX.ae_eq_mk .rfl)
159+
120160/-- Two stochastic processes $(X_s)_{s \in S}$ and $(Y_t)_{t \in T}$ are independent if
121161for all $s_1, ..., s_p \in S$ and $t_1, ..., t_q \in T$ the two families
122162$(X_{s_1}, ..., X_{s_p})$ and $(Y_{t_1}, ..., Y_{t_q})$ are independent. -/
123- lemma IndepFun.indepFun_process {T : Type *} {π§ : S β Type *} {π¨ : T β Type *}
163+ lemma IndepFun.process_indepFun_process {T : Type *} {π§ : S β Type *} {π¨ : T β Type *}
124164 [β i, MeasurableSpace (π§ i)] [β j, MeasurableSpace (π¨ j)] {X : (i : S) β Ξ© β π§ i}
125165 {Y : (j : T) β Ξ© β π¨ j} (hX : β i, Measurable (X i)) (hY : β j, Measurable (Y j))
126166 (h : β (I : Finset S) (J : Finset T),
127- IndepFun (fun Ο (i : I) β¦ X i Ο) (fun Ο (j : J) β¦ Y j Ο) P) [IsProbabilityMeasure P] :
167+ IndepFun (fun Ο (i : I) β¦ X i Ο) (fun Ο (j : J) β¦ Y j Ο) P) [IsZeroOrProbabilityMeasure P] :
128168 IndepFun (fun Ο i β¦ X i Ο) (fun Ο j β¦ Y j Ο) P :=
129- Kernel.IndepFun.indepFun_process hX hY h
169+ Kernel.IndepFun.process_indepFun_process hX hY h
130170
131171/-- Stochastic processes $((X^s_t)_{t \in T_s})_{s \in S}$ are mutually independent if
132172for all $s_1, ..., s_n$ and all $t^{s_i}_1, ..., t^{s_i}_{p_i}^ the families
@@ -135,8 +175,7 @@ $(X^{s_1}_{t^{s_1}_1}, ..., X^{s_1}_{t^{s_1}_{p_1}}), ...,
135175lemma iIndepFun.iIndepFun_process {T : S β Type *} {π§ : (i : S) β (j : T i) β Type *}
136176 [β i j, MeasurableSpace (π§ i j)] {X : (i : S) β (j : T i) β Ξ© β π§ i j}
137177 (hX : β i j, Measurable (X i j))
138- (h : β (I : Finset S) (J : (i : I) β Finset (T i)),
139- iIndepFun (fun i Ο (j : J i) β¦ X i j Ο) P) :
178+ (h : β (I : Finset S) (J : (i : I) β Finset (T i)), iIndepFun (fun i Ο (j : J i) β¦ X i j Ο) P) :
140179 iIndepFun (fun i Ο j β¦ X i j Ο) P :=
141180 Kernel.iIndepFun.iIndepFun_process hX h
142181
0 commit comments