Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(Probability/Kernel): disintegration of finite kernels #10603

Closed
wants to merge 150 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
d5f79f0
partial work towards kernel disintegration
RemyDegenne Feb 1, 2024
a9b011c
refactor defaultRatCDF
RemyDegenne Feb 1, 2024
8d1da47
remove comment
RemyDegenne Feb 1, 2024
099b859
minor
RemyDegenne Feb 1, 2024
bf37c05
more work
RemyDegenne Feb 10, 2024
2c9e449
almost done
RemyDegenne Feb 12, 2024
d9d8f9f
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Feb 12, 2024
d28bd4c
move files
RemyDegenne Feb 12, 2024
48afecb
save
RemyDegenne Feb 13, 2024
71e4115
add IsKernelCDF
RemyDegenne Feb 13, 2024
242d5f5
rename todo2 lemmas
RemyDegenne Feb 14, 2024
6ea94c4
reorganize. WIP
RemyDegenne Feb 14, 2024
8012c6d
split files
RemyDegenne Feb 14, 2024
c7492e9
generalize to finite kernel
RemyDegenne Feb 14, 2024
575a4c9
main proof done
RemyDegenne Feb 14, 2024
8edfabd
uniqueness of kernel.condexpKernel
RemyDegenne Feb 15, 2024
f708964
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Feb 15, 2024
85f4952
add Integral file
RemyDegenne Feb 15, 2024
47b1d65
move results, fix
RemyDegenne Feb 15, 2024
76961e9
docstring for Integral.lean
RemyDegenne Feb 15, 2024
9d97cb1
move/extract lemmas
RemyDegenne Feb 15, 2024
cfde47b
various minor
RemyDegenne Feb 15, 2024
be152bb
rename files
RemyDegenne Feb 15, 2024
7544dac
fix space
RemyDegenne Feb 15, 2024
be68022
docstrings in MeasurableStieltjes
RemyDegenne Feb 16, 2024
7f42f9f
add docstring
RemyDegenne Feb 16, 2024
75e3389
Mathlib.lean
RemyDegenne Feb 16, 2024
2de05e6
fix
RemyDegenne Feb 16, 2024
ef5d237
change KernelCDFBorel to prepare for kernel Radon-Nikodym
RemyDegenne Feb 17, 2024
e993e5d
rename
RemyDegenne Feb 17, 2024
b9d443b
reorder arguments
RemyDegenne Feb 17, 2024
3460efd
split file
RemyDegenne Feb 18, 2024
4fada6e
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Feb 18, 2024
3bb8792
fix
RemyDegenne Feb 18, 2024
237699e
delete again
RemyDegenne Feb 18, 2024
ac52950
Mathlib.lean
RemyDegenne Feb 18, 2024
3a77c06
fix name
RemyDegenne Feb 18, 2024
3f9519b
rename
RemyDegenne Feb 18, 2024
e6145fd
add RadonNikodym
RemyDegenne Feb 19, 2024
746ef13
Mathlib.lean
RemyDegenne Feb 19, 2024
857e3a2
move lemmas
RemyDegenne Feb 19, 2024
29ecce1
Update Mathlib/Probability/Kernel/Disintegration/RadonNikodym.lean
RemyDegenne Feb 19, 2024
4ec8637
move lemmas
RemyDegenne Feb 19, 2024
6cc7107
use CountablyGenerated
RemyDegenne Feb 20, 2024
774b862
renames and other stuff
RemyDegenne Feb 21, 2024
5fb37f9
feat: lemmas about kernel.withDensity
RemyDegenne Feb 21, 2024
45c91cd
fix
RemyDegenne Feb 21, 2024
301846d
updated docstring of Density
RemyDegenne Feb 21, 2024
d7a7608
add withDensity_add_right
RemyDegenne Feb 22, 2024
54e85f3
split partitioned
RemyDegenne Feb 22, 2024
2ae0930
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Feb 22, 2024
0d49ff1
fix
RemyDegenne Feb 22, 2024
bc9ebac
fix
RemyDegenne Feb 22, 2024
4ecd880
split file
RemyDegenne Feb 22, 2024
6342f08
docstring
RemyDegenne Feb 22, 2024
6cdfdb4
fix
RemyDegenne Feb 22, 2024
77d91ce
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Feb 22, 2024
570d243
measurability of absolutelyContinuous and mutuallySingular
RemyDegenne Feb 23, 2024
90d8e8b
rename
RemyDegenne Feb 23, 2024
64ed76a
polish Density.lean
RemyDegenne Feb 23, 2024
534fa29
docstrings
RemyDegenne Feb 23, 2024
2aa1051
typo
RemyDegenne Feb 23, 2024
777f745
more CountablyGenerated
RemyDegenne Feb 23, 2024
b0a8c0e
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Feb 24, 2024
02fa789
remove aux lemma
RemyDegenne Feb 24, 2024
9304920
split CountablyGenerated file about filtration
RemyDegenne Feb 24, 2024
659f8eb
minor
RemyDegenne Feb 25, 2024
4f47e8d
docstring
RemyDegenne Feb 25, 2024
0f501bc
feat: isCoboundedUnder_le lemmas
RemyDegenne Feb 25, 2024
f3e7ed6
feat: countable filtration in a countably generated measurable space
RemyDegenne Feb 25, 2024
c88f084
fix
RemyDegenne Feb 25, 2024
2b81b61
fix
RemyDegenne Feb 25, 2024
ec9ed75
Merge remote-tracking branch 'origin/RD_countablyGenerated' into RD_d…
RemyDegenne Feb 25, 2024
85b299b
fix imports
RemyDegenne Feb 25, 2024
000bd10
fix imports
RemyDegenne Feb 25, 2024
02bfb16
feat: density of a finite kernel wrt another kernel
RemyDegenne Feb 25, 2024
619f397
Merge remote-tracking branch 'origin/RD_cobounded' into RD_density
RemyDegenne Feb 25, 2024
0d8afaf
docstrings in RN
RemyDegenne Feb 25, 2024
e290aed
add RN for kernels
RemyDegenne Feb 25, 2024
fd76d2c
Merge remote-tracking branch 'origin/RD_withDensity' into RD_kernelRN
RemyDegenne Feb 25, 2024
0b0b32b
fix
RemyDegenne Feb 25, 2024
cdef823
Merge remote-tracking branch 'origin/RD_kernelRN' into RD_disintegration
RemyDegenne Feb 25, 2024
715bd03
delete duplicate
RemyDegenne Feb 25, 2024
cb90c8d
clean MeasurableStieltjes
RemyDegenne Feb 25, 2024
768c1b9
minor
RemyDegenne Feb 26, 2024
df6e0cb
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Feb 26, 2024
ded4b18
start docstring for CDFKernel
RemyDegenne Feb 26, 2024
1c7f426
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Feb 26, 2024
18213af
fix merge
RemyDegenne Feb 26, 2024
b05613e
rename files
RemyDegenne Feb 26, 2024
7870eb8
change variable name
RemyDegenne Feb 26, 2024
e2330f2
docstrings
RemyDegenne Feb 26, 2024
d68617d
file name, docstring
RemyDegenne Feb 27, 2024
a6a0f91
mostly variable names
RemyDegenne Feb 27, 2024
6ae4932
more work
RemyDegenne Mar 5, 2024
b61e024
refactor
RemyDegenne Mar 6, 2024
27fb33e
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Mar 6, 2024
b70a68b
fix
RemyDegenne Mar 6, 2024
b69bd87
fix
RemyDegenne Mar 6, 2024
c72e1d7
delete a file
RemyDegenne Mar 6, 2024
668182e
Mathlib.lean
RemyDegenne Mar 6, 2024
829495e
docstrings
RemyDegenne Mar 6, 2024
cef6d20
delete AuxLemmas.lean
RemyDegenne Mar 6, 2024
bf200d3
variables
RemyDegenne Mar 6, 2024
681d359
more about RN
RemyDegenne Mar 10, 2024
2d45766
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Mar 10, 2024
e584110
remove duplicates
RemyDegenne Mar 10, 2024
29e7b3c
Merge remote-tracking branch 'origin/master' into RD_density
RemyDegenne Mar 13, 2024
5b08df8
remove duplicate file
RemyDegenne Mar 13, 2024
0da240a
fix
RemyDegenne Mar 13, 2024
0ef67e7
fix Mathlib.lean
RemyDegenne Mar 13, 2024
5a4a32d
golf
RemyDegenne Mar 13, 2024
044808f
docstring
RemyDegenne Mar 13, 2024
a045ede
line length
RemyDegenne Mar 13, 2024
01b8f0c
Merge remote-tracking branch 'origin/RD_density' into RD_kernelRN
RemyDegenne Mar 13, 2024
e710493
Merge remote-tracking branch 'origin/RD_kernelRN' into RD_disintegration
RemyDegenne Mar 13, 2024
ae81116
remove duplicates
RemyDegenne Mar 13, 2024
6b69634
refactor, with todo names
RemyDegenne Mar 13, 2024
7f5adfd
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Mar 20, 2024
297ade4
minor changes in CondCdf
RemyDegenne Mar 20, 2024
a9557bc
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Mar 27, 2024
8edbc01
fix merge
RemyDegenne Mar 27, 2024
6029651
remove duplicate
RemyDegenne Mar 27, 2024
54dd5ee
fix
RemyDegenne Mar 27, 2024
99f0bc0
remove unrelated material
RemyDegenne Mar 29, 2024
cdaeb0a
remove import
RemyDegenne Mar 29, 2024
d264e3a
rename embeddingReal
RemyDegenne Mar 29, 2024
6350608
make condKernel irreducible
RemyDegenne Mar 29, 2024
cea5547
don't use Omega'
RemyDegenne Mar 29, 2024
e2dc65a
move CountableOrCountablyGenerated
RemyDegenne Mar 29, 2024
1529974
undo changes to condCdf
RemyDegenne Mar 29, 2024
a089953
add docstrings to Basic
RemyDegenne Mar 31, 2024
00b0862
add docstrings in Unique.lean
RemyDegenne Mar 31, 2024
f5704dc
fix
RemyDegenne Mar 31, 2024
3ddfbd8
golf Unique
RemyDegenne Apr 1, 2024
b556324
lint
RemyDegenne Apr 1, 2024
c361742
remove assumption to see what breaks
sgouezel Apr 3, 2024
2e9b90b
measurable atoms
sgouezel Apr 5, 2024
9325b62
start fixing
sgouezel Apr 5, 2024
0c3e29e
move to better place, lint, cleanup
sgouezel Apr 5, 2024
486309d
fix docstring
RemyDegenne Apr 6, 2024
cb76215
refactor real to Borel
RemyDegenne Apr 7, 2024
a28997d
remove unused import
RemyDegenne Apr 7, 2024
950ddf7
fix merge conflict
RemyDegenne Apr 12, 2024
427687c
remove some completeness assumptions
sgouezel Apr 16, 2024
94bf67e
lint
sgouezel Apr 16, 2024
1ab7657
Merge remote-tracking branch 'origin/master' into RD_disintegration
RemyDegenne Apr 16, 2024
51952fc
Apply suggestions from code review
RemyDegenne Apr 16, 2024
4c40319
create Real section at the top of Disintegration/Basic
RemyDegenne Apr 16, 2024
0081cac
irreducible_def
RemyDegenne Apr 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3235,11 +3235,13 @@ import Mathlib.Probability.Kernel.Basic
import Mathlib.Probability.Kernel.Composition
import Mathlib.Probability.Kernel.CondDistrib
import Mathlib.Probability.Kernel.Condexp
import Mathlib.Probability.Kernel.Disintegration
import Mathlib.Probability.Kernel.Disintegration.Basic
RemyDegenne marked this conversation as resolved.
Show resolved Hide resolved
RemyDegenne marked this conversation as resolved.
Show resolved Hide resolved
import Mathlib.Probability.Kernel.Disintegration.CdfToKernel
RemyDegenne marked this conversation as resolved.
Show resolved Hide resolved
import Mathlib.Probability.Kernel.Disintegration.CondCdf
RemyDegenne marked this conversation as resolved.
Show resolved Hide resolved
import Mathlib.Probability.Kernel.Disintegration.Density
import Mathlib.Probability.Kernel.Disintegration.Integral
RemyDegenne marked this conversation as resolved.
Show resolved Hide resolved
import Mathlib.Probability.Kernel.Disintegration.MeasurableStieltjes
import Mathlib.Probability.Kernel.Disintegration.Unique
import Mathlib.Probability.Kernel.IntegralCompProd
RemyDegenne marked this conversation as resolved.
Show resolved Hide resolved
RemyDegenne marked this conversation as resolved.
Show resolved Hide resolved
import Mathlib.Probability.Kernel.Invariance
import Mathlib.Probability.Kernel.MeasurableIntegral
Expand Down
9 changes: 9 additions & 0 deletions Mathlib/MeasureTheory/Constructions/Polish.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1091,4 +1091,13 @@ theorem exists_measurableEmbedding_real : ∃ f : α → ℝ, MeasurableEmbeddin
exact ⟨(↑) ∘ e, (MeasurableEmbedding.subtype_coe hs).comp e.measurableEmbedding⟩
#align measure_theory.exists_measurable_embedding_real MeasureTheory.exists_measurableEmbedding_real

/-- A measurable embedding of a standard Borel space into `ℝ`. -/
noncomputable
def embeddingReal (Ω : Type*) [MeasurableSpace Ω] [StandardBorelSpace Ω] : Ω → ℝ :=
(exists_measurableEmbedding_real Ω).choose

lemma measurableEmbedding_embeddingReal (Ω : Type*) [MeasurableSpace Ω] [StandardBorelSpace Ω] :
MeasurableEmbedding (embeddingReal Ω) :=
(exists_measurableEmbedding_real Ω).choose_spec

end MeasureTheory
66 changes: 61 additions & 5 deletions Mathlib/MeasureTheory/MeasurableSpace/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,53 @@ theorem measurable_of_measurable_on_compl_singleton [MeasurableSingletonClass α

end Subtype

section Atoms

variable [MeasurableSpace β]

/-- The *measurable atom* of `x` is the intersection of all the measurable sets countaining `x`.
It is measurable when the space is countable (or more generally when the measurable space is
countably generated). -/
def measurableAtom (x : β) : Set β :=
⋂ (s : Set β) (_h's : x ∈ s) (_hs : MeasurableSet s), s

@[simp] lemma mem_measurableAtom_self (x : β) : x ∈ measurableAtom x := by
simp (config := {contextual := true}) [measurableAtom]

lemma mem_of_mem_measurableAtom {x y : β} (h : y ∈ measurableAtom x) {s : Set β}
(hs : MeasurableSet s) (hxs : x ∈ s) : y ∈ s := by
simp only [measurableAtom, mem_iInter] at h
exact h s hxs hs

lemma measurableAtom_subset {s : Set β} {x : β} (hs : MeasurableSet s) (hx : x ∈ s) :
measurableAtom x ⊆ s :=
iInter₂_subset_of_subset s hx fun ⦃a⦄ ↦ (by simp [hs])

@[simp] lemma measurableAtom_of_measurableSingletonClass [MeasurableSingletonClass β] (x : β) :
measurableAtom x = {x} :=
Subset.antisymm (measurableAtom_subset (measurableSet_singleton x) rfl) (by simp)

lemma MeasurableSet.measurableAtom_of_countable [Countable β] (x : β) :
MeasurableSet (measurableAtom x) := by
have : ∀ (y : β), y ∉ measurableAtom x → ∃ s, MeasurableSet s ∧ x ∈ s ∧ y ∉ s :=
fun y hy ↦ by simpa [measurableAtom] using hy
choose! s hs using this
have : measurableAtom x = ⋂ (y ∈ (measurableAtom x)ᶜ), s y := by
apply Subset.antisymm
· intro z hz
simp only [mem_iInter, mem_compl_iff]
intro i hi
show z ∈ s i
exact mem_of_mem_measurableAtom hz (hs i hi).1 (hs i hi).2.1
· apply compl_subset_compl.1
intro z hz
simp only [compl_iInter, mem_iUnion, mem_compl_iff, exists_prop]
exact ⟨z, hz, (hs z hz).2.2⟩
rw [this]
exact MeasurableSet.biInter (to_countable (measurableAtom x)ᶜ) (fun i hi ↦ (hs i hi).1)

end Atoms

section Prod

/-- A `MeasurableSpace` structure on the product of two measurable spaces. -/
Expand Down Expand Up @@ -813,14 +860,23 @@ instance Prod.instMeasurableSingletonClass
⟨fun ⟨a, b⟩ => @singleton_prod_singleton _ _ a b ▸ .prod (.singleton a) (.singleton b)⟩
#align prod.measurable_singleton_class Prod.instMeasurableSingletonClass

theorem measurable_from_prod_countable [Countable β] [MeasurableSingletonClass β]
{_ : MeasurableSpace γ} {f : α × β → γ} (hf : ∀ y, Measurable fun x => f (x, y)) :
theorem measurable_from_prod_countable' [Countable β]
{_ : MeasurableSpace γ} {f : α × β → γ} (hf : ∀ y, Measurable fun x => f (x, y))
(h'f : ∀ y y' x, y' ∈ measurableAtom y → f (x, y') = f (x, y)) :
Measurable f := fun s hs => by
have : f ⁻¹' s = ⋃ y, ((fun x => f (x, y)) ⁻¹' s) ×ˢ ({y} : Set β) := by
have : f ⁻¹' s = ⋃ y, ((fun x => f (x, y)) ⁻¹' s) ×ˢ (measurableAtom y : Set β) := by
ext1 ⟨x, y⟩
simp [and_assoc, and_left_comm]
simp only [mem_preimage, mem_iUnion, mem_prod]
refine ⟨fun h ↦ ⟨y, h, mem_measurableAtom_self y⟩, ?_⟩
rintro ⟨y', hy's, hy'⟩
rwa [h'f y' y x hy']
rw [this]
exact .iUnion fun y => (hf y hs).prod (.singleton y)
exact .iUnion (fun y ↦ (hf y hs).prod (.measurableAtom_of_countable y))

theorem measurable_from_prod_countable [Countable β] [MeasurableSingletonClass β]
{_ : MeasurableSpace γ} {f : α × β → γ} (hf : ∀ y, Measurable fun x => f (x, y)) :
Measurable f :=
measurable_from_prod_countable' hf (by simp (config := {contextual := true}))
#align measurable_from_prod_countable measurable_from_prod_countable

/-- A piecewise function on countably many pieces is measurable if all the data is measurable. -/
Expand Down
38 changes: 35 additions & 3 deletions Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,23 @@ theorem CountablyGenerated.sup {m₁ m₂ : MeasurableSpace β} (h₁ : @Countab
rcases h₂ with ⟨⟨b₂, hb₂c, rfl⟩⟩
exact @mk _ (_ ⊔ _) ⟨_, hb₁c.union hb₂c, generateFrom_sup_generateFrom⟩

instance (priority := 100) [MeasurableSpace α] [Finite α] : CountablyGenerated α where
isCountablyGenerated :=
⟨{s | MeasurableSet s}, Set.to_countable _, generateFrom_measurableSet.symm⟩
/-- Any measurable space structure on a countable space is countably generated. -/
instance (priority := 100) [MeasurableSpace α] [Countable α] : CountablyGenerated α where
isCountablyGenerated := by
refine ⟨⋃ y, {measurableAtom y}, countable_iUnion (fun i ↦ countable_singleton _), ?_⟩
refine le_antisymm ?_ (generateFrom_le (by simp [MeasurableSet.measurableAtom_of_countable]))
intro s hs
have : s = ⋃ y ∈ s, measurableAtom y := by
apply Subset.antisymm
· intro x hx
simpa using ⟨x, hx, by simp⟩
· simp only [iUnion_subset_iff]
intro x hx
exact measurableAtom_subset hs hx
rw [this]
apply MeasurableSet.biUnion (to_countable s) (fun x _hx ↦ ?_)
apply measurableSet_generateFrom
simp

instance [MeasurableSpace α] [CountablyGenerated α] {p : α → Prop} :
CountablyGenerated { x // p x } := .comap _
Expand Down Expand Up @@ -455,4 +469,22 @@ lemma measurableSet_countablePartitionSet (n : ℕ) (a : α) :
MeasurableSet (countablePartitionSet n a) :=
measurableSet_countablePartition n (countablePartitionSet_mem n a)

section CountableOrCountablyGenerated

variable [MeasurableSpace β]

/-- A class registering that either `α` is countable or `β` is a countably generated
measurable space. -/
class CountableOrCountablyGenerated (α β : Type*) [MeasurableSpace α] [MeasurableSpace β] : Prop :=
countableOrCountablyGenerated : Countable α ∨ MeasurableSpace.CountablyGenerated β

instance instCountableOrCountablyGeneratedOfCountable [h1 : Countable α] :
CountableOrCountablyGenerated α β := ⟨Or.inl h1⟩

instance instCountableOrCountablyGeneratedOfCountablyGenerated
[h : MeasurableSpace.CountablyGenerated β] :
CountableOrCountablyGenerated α β := ⟨Or.inr h⟩

end CountableOrCountablyGenerated

end MeasurableSpace
19 changes: 19 additions & 0 deletions Mathlib/Probability/Kernel/Composition.lean
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,25 @@ lemma compProd_add_right (μ : kernel α β) (κ η : kernel (α × β) γ)
rw [lintegral_add_left]
exact measurable_kernel_prod_mk_left' hs a

lemma comapRight_compProd_id_prod {δ : Type*} {mδ : MeasurableSpace δ}
(κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ) [IsSFiniteKernel η]
{f : δ → γ} (hf : MeasurableEmbedding f) :
comapRight (κ ⊗ₖ η) (MeasurableEmbedding.id.prod_mk hf) = κ ⊗ₖ (comapRight η hf) := by
ext a t ht
rw [comapRight_apply' _ _ _ ht, compProd_apply, compProd_apply _ _ _ ht]
swap; · exact (MeasurableEmbedding.id.prod_mk hf).measurableSet_image.mpr ht
refine lintegral_congr (fun b ↦ ?_)
simp only [id_eq, Set.mem_image, Prod.mk.injEq, Prod.exists]
rw [comapRight_apply']
swap; · exact measurable_prod_mk_left ht
congr with x
simp only [Set.mem_setOf_eq, Set.mem_image]
constructor
· rintro ⟨b', c, h, rfl, rfl⟩
exact ⟨c, h, rfl⟩
· rintro ⟨c, h, rfl⟩
exact ⟨b, c, h, rfl, rfl⟩

end CompositionProduct

section MapComap
Expand Down
10 changes: 5 additions & 5 deletions Mathlib/Probability/Kernel/CondDistrib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.Probability.Kernel.Disintegration
import Mathlib.Probability.Kernel.Disintegration.Unique
import Mathlib.Probability.Notation

#align_import probability.kernel.cond_distrib from "leanprover-community/mathlib"@"00abe0695d8767201e6d008afa22393978bb324d"
Expand Down Expand Up @@ -74,7 +74,7 @@ variable {mβ : MeasurableSpace β} {s : Set Ω} {t : Set β} {f : β × Ω →
lemma condDistrib_apply_of_ne_zero [MeasurableSingletonClass β]
(hY : Measurable Y) (x : β) (hX : μ.map X {x} ≠ 0) (s : Set Ω) :
condDistrib Y X μ x s = (μ.map X {x})⁻¹ * μ.map (fun a => (X a, Y a)) ({x} ×ˢ s) := by
rw [condDistrib, condKernel_apply_of_ne_zero _ s]
rw [condDistrib, Measure.condKernel_apply_of_ne_zero _ s]
· rw [Measure.fst_map_prod_mk hY]
· rwa [Measure.fst_map_prod_mk hY]

Expand Down Expand Up @@ -125,7 +125,7 @@ theorem condDistrib_ae_eq_of_measure_eq_compProd (hX : Measurable X) (hY : Measu
rw [Measure.map_apply hX hs, Measure.fst_apply hs, Measure.map_apply]
exacts [rfl, Measurable.prod hX hY, measurable_fst hs]
rw [heq, condDistrib]
refine' eq_condKernel_of_measure_eq_compProd _ _ _
refine eq_condKernel_of_measure_eq_compProd _ ?_
convert hκ
exact heq.symm

Expand Down Expand Up @@ -202,7 +202,7 @@ theorem set_lintegral_preimage_condDistrib (hX : Measurable X) (hY : AEMeasurabl
-- (`rw` does not see that the two forms are defeq)
conv_lhs => arg 2; change (fun a => ((condDistrib Y X μ) a) s) ∘ X
rw [lintegral_comp (kernel.measurable_coe _ hs) hX, condDistrib, ← Measure.restrict_map hX ht, ←
Measure.fst_map_prod_mk₀ hY, set_lintegral_condKernel_eq_measure_prod _ ht hs,
Measure.fst_map_prod_mk₀ hY, Measure.set_lintegral_condKernel_eq_measure_prod ht hs,
Measure.map_apply_of_aemeasurable (hX.aemeasurable.prod_mk hY) (ht.prod hs), mk_preimage_prod]
#align probability_theory.set_lintegral_preimage_cond_distrib ProbabilityTheory.set_lintegral_preimage_condDistrib

Expand Down Expand Up @@ -248,7 +248,7 @@ theorem condexp_prod_ae_eq_integral_condDistrib' [NormedSpace ℝ F] [CompleteSp
· rw [← Measure.restrict_map hX ht]
exact (hf_int.1.integral_condDistrib_map hY).restrict
rw [← Measure.restrict_map hX ht, ← Measure.fst_map_prod_mk₀ hY, condDistrib,
set_integral_condKernel_univ_right ht hf_int.integrableOn,
Measure.set_integral_condKernel_univ_right ht hf_int.integrableOn,
set_integral_map (ht.prod MeasurableSet.univ) hf_int.1 (hX.aemeasurable.prod_mk hY),
mk_preimage_prod, preimage_univ, inter_univ]
· exact aestronglyMeasurable'_integral_condDistrib hX.aemeasurable hY hf_int.1
Expand Down
8 changes: 4 additions & 4 deletions Mathlib/Probability/Kernel/Condexp.lean
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ theorem stronglyMeasurable_condexpKernel {s : Set Ω} (hs : MeasurableSet s) :
Measurable.stronglyMeasurable (measurable_condexpKernel hs)

theorem _root_.MeasureTheory.AEStronglyMeasurable.integral_condexpKernel [NormedSpace ℝ F]
[CompleteSpace F] (hf : AEStronglyMeasurable f μ) :
(hf : AEStronglyMeasurable f μ) :
AEStronglyMeasurable (fun ω => ∫ y, f y ∂condexpKernel μ m ω) μ := by
simp_rw [condexpKernel_apply_eq_condDistrib]
exact AEStronglyMeasurable.integral_condDistrib
(aemeasurable_id'' μ (inf_le_right : m ⊓ mΩ ≤ mΩ)) aemeasurable_id
(hf.comp_snd_map_prod_id inf_le_right)
#align measure_theory.ae_strongly_measurable.integral_condexp_kernel MeasureTheory.AEStronglyMeasurable.integral_condexpKernel

theorem aestronglyMeasurable'_integral_condexpKernel [NormedSpace ℝ F] [CompleteSpace F]
theorem aestronglyMeasurable'_integral_condexpKernel [NormedSpace ℝ F]
(hf : AEStronglyMeasurable f μ) :
AEStronglyMeasurable' m (fun ω => ∫ y, f y ∂condexpKernel μ m ω) μ := by
rw [condexpKernel]
Expand Down Expand Up @@ -139,15 +139,15 @@ theorem _root_.MeasureTheory.Integrable.integral_norm_condexpKernel (hf_int : In
#align measure_theory.integrable.integral_norm_condexp_kernel MeasureTheory.Integrable.integral_norm_condexpKernel

theorem _root_.MeasureTheory.Integrable.norm_integral_condexpKernel [NormedSpace ℝ F]
[CompleteSpace F] (hf_int : Integrable f μ) :
(hf_int : Integrable f μ) :
Integrable (fun ω => ‖∫ y, f y ∂condexpKernel μ m ω‖) μ := by
rw [condexpKernel]
exact Integrable.norm_integral_condDistrib
(aemeasurable_id'' μ (inf_le_right : m ⊓ mΩ ≤ mΩ)) aemeasurable_id
(hf_int.comp_snd_map_prod_id (inf_le_right : m ⊓ mΩ ≤ mΩ))
#align measure_theory.integrable.norm_integral_condexp_kernel MeasureTheory.Integrable.norm_integral_condexpKernel

theorem _root_.MeasureTheory.Integrable.integral_condexpKernel [NormedSpace ℝ F] [CompleteSpace F]
theorem _root_.MeasureTheory.Integrable.integral_condexpKernel [NormedSpace ℝ F]
(hf_int : Integrable f μ) :
Integrable (fun ω => ∫ y, f y ∂condexpKernel μ m ω) μ := by
rw [condexpKernel]
Expand Down