cfahlgren1/math / lean /OAI /Probability /FreeIsing /Estimates /ObservableDisintegration.lean
cfahlgren1's picture
download
raw
4.28 kB
15
def graphLaw (P : Measure X) (Z : X → W) : Measure (W × X) :=
body · 1 line
  P.map (fun x => (Z x, x))
18
instance graphLaw_finite (P : Measure X) [IsFiniteMeasure P] (Z : X → W) :
    IsFiniteMeasure (graphLaw P Z) := by
body · 2 lines
  unfold graphLaw
  infer_instance
24
private theorem measurable_graphMap {Z : X → W} (hZ : Measurable Z) :
    Measurable (fun x => (Z x, x)) := hZ.prodMk measurable_id
27
def kernel (P : Measure X) [IsFiniteMeasure P] (Z : X → W) : Kernel W X :=
body · 1 line
  (graphLaw P Z).condKernel
30
instance kernel_isMarkov (P : Measure X) [IsFiniteMeasure P] (Z : X → W) :
    IsMarkovKernel (kernel P Z) := by
body · 2 lines
  unfold kernel
  infer_instance
36
theorem fst_graphLaw (P : Measure X) {Z : X → W} (hZ : Measurable Z) :
    (graphLaw P Z).fst = P.map Z := by
proof · 3 lines
  change (P.map (fun x => (Z x, x))).map Prod.fst = P.map Z
  rw [Measure.map_map measurable_fst (measurable_graphMap hZ)]
  rfl
43
theorem snd_graphLaw (P : Measure X) {Z : X → W} (hZ : Measurable Z) :
    (graphLaw P Z).snd = P := by
proof · 3 lines
  change (P.map (fun x => (Z x, x))).map Prod.snd = P
  rw [Measure.map_map measurable_snd (measurable_graphMap hZ)]
  exact Measure.map_id
49
theorem compProd_kernel (P : Measure X) [IsFiniteMeasure P]
    {Z : X → W} (hZ : Measurable Z) :
    (P.map Z) ⊗ₘ kernel P Z = graphLaw P Z := by
proof · 2 lines
  rw [← fst_graphLaw P hZ]
  exact Measure.disintegrate (graphLaw P Z) (graphLaw P Z).condKernel
55
theorem compProd_kernel_of_map_eq (P : Measure X) [IsFiniteMeasure P]
    {Z : X → W} (hZ : Measurable Z) (mu : Measure W)
    (hLaw : P.map Z = mu) : mu ⊗ₘ kernel P Z = graphLaw P Z := by
proof · 2 lines
  rw [← hLaw]
  exact compProd_kernel P hZ
61
theorem measurePreserving_snd_kernel (P : Measure X) [IsFiniteMeasure P]
    {Z : X → W} (hZ : Measurable Z) :
    MeasurePreserving Prod.snd ((P.map Z) ⊗ₘ kernel P Z) P := by
proof · 3 lines
  refine ⟨measurable_snd, ?_⟩
  rw [compProd_kernel P hZ]
  exact snd_graphLaw P hZ
68
theorem ae_observable_eq_input [MeasurableEq W]
    (P : Measure X) [IsFiniteMeasure P] {Z : X → W} (hZ : Measurable Z) :
    ∀ᵐ p ∂(P.map Z) ⊗ₘ kernel P Z, Z p.2 = p.1 := by
proof · 4 lines
  rw [compProd_kernel P hZ]
  apply (ae_map_iff (hZ.prodMk measurable_id).aemeasurable
    (measurableSet_eq_fun (hZ.comp measurable_snd) measurable_fst)).2
  exact Filter.Eventually.of_forall (fun _ => rfl)
78
theorem graphLaw_invariant (P : Measure X)
    {Z : X → W} (hZ : Measurable Z)
    {T : W → W} {S : X → X} (hT : Measurable T)
    (hS : MeasurePreserving S P P)
    (heq : ∀ᵐ x ∂P, Z (S x) = T (Z x)) :
    (graphLaw P Z).map (Prod.map T S) = graphLaw P Z := by
proof · 4 lines
  apply FactorTransport.map_invariant_of_ae_equivariant hS
    (hT.prodMap hS.measurable) (hZ.prodMk measurable_id)
  filter_upwards [heq] with x hx
  exact Prod.ext hx rfl
89
theorem joint_kernel_invariant (P : Measure X) [IsFiniteMeasure P]
    {Z : X → W} (hZ : Measurable Z)
    {T : W → W} {S : X → X} (hT : Measurable T)
    (hS : MeasurePreserving S P P)
    (heq : ∀ᵐ x ∂P, Z (S x) = T (Z x)) :
    ((P.map Z) ⊗ₘ kernel P Z).map (Prod.map T S) =
      (P.map Z) ⊗ₘ kernel P Z := by
proof · 2 lines
  rw [compProd_kernel P hZ]
  exact graphLaw_invariant P hZ hT hS heq
99
theorem ae_conditionalCopies_observable [MeasurableEq W]
    (P : Measure X) [IsFiniteMeasure P] {Z : X → W} (hZ : Measurable Z) :
    ∀ᵐ p ∂(P.map Z) ⊗ₘ ((kernel P Z) ×ₖ (kernel P Z)),
      Z p.2.1 = p.1 ∧ Z p.2.2 = p.1 := by
proof · 6 lines
  have hf := (measurePreserving_conditionalCopy_fst (P.map Z) (kernel P Z)).quasiMeasurePreserving.ae
    (ae_observable_eq_input P hZ)
  have hs := (measurePreserving_conditionalCopy_snd (P.map Z) (kernel P Z)).quasiMeasurePreserving.ae
    (ae_observable_eq_input P hZ)
  filter_upwards [hf, hs] with p hp hq
  exact ⟨hp, hq⟩

Xet Storage Details

Size:
4.28 kB
·
Xet hash:
db48795a3ad118b3cd3d7cad63a53a2d290cb2cc4c9acb1d8c438ad00ff5f7c0

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.