Skip to content

Commit 1233591

Browse files
committed
feat(Probability): CondIndepFun lemmas (#29554)
Lemmas about conditional independence of constant random variables and of random variables that are measurable with respect to the sigma-algebra that we are conditioning on. From the LeanBandits project. Co-authored-by: Remy Degenne <remydegenne@gmail.com>
1 parent cffe679 commit 1233591

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

Mathlib/Probability/Independence/Basic.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,16 @@ theorem IndepFun.comp₀ {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpace β
733733
IndepFun (φ ∘ f) (ψ ∘ g) μ :=
734734
Kernel.IndepFun.comp₀ hfg (by simp [hf]) (by simp [hg]) (by simp [hφ]) (by simp [hψ])
735735

736+
lemma indepFun_const_left {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
737+
[IsZeroOrProbabilityMeasure μ] (c : β) (X : Ω → β') :
738+
IndepFun (fun _ ↦ c) X μ :=
739+
Kernel.indepFun_const_left c X
740+
741+
lemma indepFun_const_right {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
742+
[IsZeroOrProbabilityMeasure μ] (X : Ω → β) (c : β') :
743+
IndepFun X (fun _ ↦ c) μ :=
744+
Kernel.indepFun_const_right X c
745+
736746
theorem IndepFun.neg_right {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpace β'} [Neg β']
737747
[MeasurableNeg β'] (hfg : IndepFun f g μ) :
738748
IndepFun f (-g) μ := hfg.comp measurable_id measurable_neg

Mathlib/Probability/Independence/Conditional.lean

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,8 @@ theorem condIndepFun_iff_condIndepSet_preimage {mβ : MeasurableSpace β} {mβ'
676676
simp only [CondIndepFun, CondIndepSet, Kernel.indepFun_iff_indepSet_preimage hf hg]
677677

678678
@[symm]
679-
nonrec theorem CondIndepFun.symm {_ : MeasurableSpace β} {f g : Ω → β}
680-
(hfg : CondIndepFun m' hm' f g μ) :
679+
nonrec theorem CondIndepFun.symm { : MeasurableSpace β} {mβ' : MeasurableSpace β'}
680+
{f : Ω → β} {g : Ω → β'} (hfg : CondIndepFun m' hm' f g μ) :
681681
CondIndepFun m' hm' g f μ :=
682682
hfg.symm
683683

@@ -687,6 +687,16 @@ theorem CondIndepFun.comp {γ γ' : Type*} {_mβ : MeasurableSpace β} {_mβ' :
687687
CondIndepFun m' hm' (φ ∘ f) (ψ ∘ g) μ :=
688688
Kernel.IndepFun.comp hfg hφ hψ
689689

690+
lemma condIndepFun_const_left {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
691+
(c : β) (X : Ω → β') :
692+
CondIndepFun m' hm' (fun _ ↦ c) X μ :=
693+
Kernel.indepFun_const_left c X
694+
695+
lemma condIndepFun_const_right {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
696+
(X : Ω → β) (c : β') :
697+
CondIndepFun m' hm' X (fun _ ↦ c) μ :=
698+
Kernel.indepFun_const_right X c
699+
690700
theorem CondIndepFun.neg_right {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpace β'} [Neg β']
691701
[MeasurableNeg β'] (hfg : CondIndepFun m' hm' f g μ) :
692702
CondIndepFun m' hm' f (-g) μ := hfg.comp measurable_id measurable_neg
@@ -695,6 +705,38 @@ theorem CondIndepFun.neg_left {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpa
695705
[MeasurableNeg β] (hfg : CondIndepFun m' hm' f g μ) :
696706
CondIndepFun m' hm' (-f) g μ := hfg.comp measurable_neg measurable_id
697707

708+
lemma condIndepFun_of_measurable_left {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
709+
{X : Ω → β} {Y : Ω → β'} (hX : Measurable[m'] X) (hY : Measurable Y) :
710+
CondIndepFun m' hm' X Y μ := by
711+
rw [condIndepFun_iff _ hm' _ _ (hX.mono hm' le_rfl) hY]
712+
rintro _ _ ⟨s, hs, rfl⟩ ⟨t, ht, rfl⟩
713+
rw [show (fun ω : Ω ↦ (1 : ℝ)) = 1 from rfl, Set.inter_indicator_one]
714+
calc μ[(X ⁻¹' s).indicator 1 * (Y ⁻¹' t).indicator 1|m']
715+
_ =ᵐ[μ] (X ⁻¹' s).indicator 1 * μ[(Y ⁻¹' t).indicator 1|m'] := by
716+
refine condExp_stronglyMeasurable_mul_of_bound hm' (stronglyMeasurable_const.indicator (hX hs))
717+
((integrable_indicator_iff (hY ht)).2 integrableOn_const) 1 (ae_of_all μ fun ω ↦ ?_)
718+
rw [Set.indicator]
719+
split_ifs with h <;> simp
720+
_ =ᵐ[μ] μ[(X ⁻¹' s).indicator 1|m'] * μ[(Y ⁻¹' t).indicator 1|m'] := by
721+
nth_rw 2 [condExp_of_stronglyMeasurable hm']
722+
· exact stronglyMeasurable_const.indicator (hX hs)
723+
· exact (integrable_indicator_iff ((hX.le hm') hs)).2 integrableOn_const
724+
725+
lemma condIndepFun_of_measurable_right {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
726+
{X : Ω → β} {Y : Ω → β'} (hX : Measurable X) (hY : Measurable[m'] Y) :
727+
CondIndepFun m' hm' X Y μ :=
728+
(condIndepFun_of_measurable_left hY hX).symm
729+
730+
lemma condIndepFun_self_left {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
731+
{X : Ω → β} {Z : Ω → β'} (hX : Measurable X) (hZ : Measurable Z) :
732+
CondIndepFun (mβ'.comap Z) hZ.comap_le Z X μ :=
733+
condIndepFun_of_measurable_left (comap_measurable Z) hX
734+
735+
lemma condIndepFun_self_right {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
736+
{X : Ω → β} {Z : Ω → β'} (hX : Measurable X) (hZ : Measurable Z) :
737+
CondIndepFun (mβ'.comap Z) hZ.comap_le X Z μ :=
738+
condIndepFun_of_measurable_right hX (comap_measurable Z)
739+
698740
section iCondIndepFun
699741
variable {β : ι → Type*} {m : ∀ i, MeasurableSpace (β i)} {f : ∀ i, Ω → β i}
700742

Mathlib/Probability/Independence/Kernel.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,17 @@ theorem IndepFun.comp₀ {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
10001000
filter_upwards [haψ] with ω hωψ
10011001
simp [hωψ]
10021002

1003+
lemma indepFun_const_left {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
1004+
[IsZeroOrMarkovKernel κ] (c : β') (X : Ω → β) :
1005+
IndepFun (fun _ ↦ c) X κ μ := by
1006+
rw [IndepFun, MeasurableSpace.comap_const]
1007+
exact indep_bot_left _
1008+
1009+
lemma indepFun_const_right {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
1010+
[IsZeroOrMarkovKernel κ] (X : Ω → β) (c : β') :
1011+
IndepFun X (fun _ ↦ c) κ μ :=
1012+
(indepFun_const_left c X).symm
1013+
10031014
theorem IndepFun.neg_right {_mβ : MeasurableSpace β} {_mβ' : MeasurableSpace β'} [Neg β']
10041015
[MeasurableNeg β'] (hfg : IndepFun f g κ μ) :
10051016
IndepFun f (-g) κ μ := hfg.comp measurable_id measurable_neg

0 commit comments

Comments
 (0)