File size: 4,178 Bytes
67aee1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import Mathlib
import OAI.Analysis.HardSphere.Comparison.ConditionalLikelihood

namespace OAI

noncomputable section
open MeasureTheory ProbabilityTheory
open scoped ENNReal
open MeasureTheory Function Set Filter
open scoped ENNReal BigOperators
namespace HardSphere.Comparison
open ProbabilityTheory
section ReferenceMeasure
variable {ι : Type*} [DecidableEq ι] {X : ι → Type*}
  [∀ i, MeasurableSpace (X i)] {R : Type*} [Fintype R]
  (reference : R → LocalCheck X)
  (μ : ∀ i, Measure (X i)) [∀ i, IsProbabilityMeasure (μ i)]
omit [∀ i, IsProbabilityMeasure (μ i)] in
lemma lintegral_referenceMeasure (s : Finset ι) (x : ∀ i, X i)
    (f : (∀ i, X i) → ℝ≥0∞) (hf : Measurable f) :
    (∫⁻ u, f (Function.updateFinset x s u) ∂referenceMeasure reference μ s x) =
      lmarginal μ s (fun y ↦ checkWeight reference s y * f y) x /
        checkNormalizer reference μ s x := by
  change (∫⁻ u, f (Function.updateFinset x s u)
    ∂(Measure.pi (fun i : s ↦ μ i)).withDensity
      (fun u ↦ checkWeight reference s (Function.updateFinset x s u) /
        checkNormalizer reference μ s x)) = _
  have hD : Measurable (fun u : ∀ i : s, X i ↦
      checkWeight reference s (Function.updateFinset x s u) / checkNormalizer reference μ s x) :=
    ((measurable_checkWeight reference s).comp measurable_updateFinset).div_const _
  have hF : Measurable (fun u : ∀ i : s, X i ↦ f (Function.updateFinset x s u)) :=
    hf.comp measurable_updateFinset
  rw [lintegral_withDensity_eq_lintegral_mul (Measure.pi (fun i : s ↦ μ i)) hD hF]
  simp only [Pi.mul_apply, div_eq_mul_inv]
  simp_rw [mul_right_comm _ _ (f _)]
  exact lintegral_mul_const _
    (((measurable_checkWeight reference s).mul hf).comp measurable_updateFinset)

end ReferenceMeasure

variable {ι : Type*} [DecidableEq ι] {X Z : ι → Type*}
  [∀ i, MeasurableSpace (X i)] [∀ i, MeasurableSpace (Z i)]
  {R C : Type*} [Fintype R] [Fintype C]
  (reference : R → LocalCheck X) (checks : C → LocalCheck (fun i ↦ X i × Z i))
  (μ : ∀ i, Measure (X i)) [∀ i, IsProbabilityMeasure (μ i)]
  (κ : ∀ i, Kernel (X i) (Z i)) [∀ i, IsFiniteKernel (κ i)]

theorem conditionalLikelihood_mean (s o : Finset ι) (hso : Disjoint s o)
    {a : ℝ≥0∞} (ha : 0 < a)
    (hκm : ∀ i, ∫⁻ x, κ i x Set.univ ∂μ i = 1)
    (hRef : UniformInsertionOn reference μ a (s ∪ o))
    (hcompat : UniformInsertionOn checks (fun i ↦ (μ i).compProd (κ i)) a s)
    (hOutside : ∀ (x : ∀ i, X i) (z : ∀ i, Z i), x ∈ retainedEvent reference o →
      (fun i ↦ (x i,z i)) ∈ retainedEvent checks o)
    (hincl : ∀ (x : ∀ i, X i) (z : ∀ i, Z i),
      checkWeight checks (s ∪ o) (fun i ↦ (x i,z i)) ≤ checkWeight reference (s ∪ o) x)
    (x : ∀ i, X i) (z : ∀ i, Z i) :
    (∫⁻ u, conditionalLikelihood reference checks μ κ s o
      (Function.updateFinset x (s ∪ o) u) z ∂referenceMeasure reference μ (s ∪ o) x) = 1 := by
  rw [lintegral_referenceMeasure reference μ (s ∪ o) x _
    (measurable_conditionalLikelihood reference checks μ κ s o z)]
  have hm := (measurable_checkWeight reference (s ∪ o)).mul
    (measurable_conditionalLikelihood reference checks μ κ s o z)
  have heq : lmarginal μ s (fun y ↦ checkWeight reference (s ∪ o) y *
      conditionalLikelihood reference checks μ κ s o y z) =
      partialNormalizer reference μ s o := by
    funext y
    exact conditionalLikelihood_marginal reference checks μ κ s o hso ha hκm hcompat
      hOutside hincl y z
  rw [lmarginal_union' μ (fun y ↦ checkWeight reference (s ∪ o) y *
    conditionalLikelihood reference checks μ κ s o y z) hm hso, heq]
  have hZ : lmarginal μ o (partialNormalizer reference μ s o) =
      checkNormalizer reference μ (s ∪ o) := by
    exact (lmarginal_union' μ (checkWeight reference (s ∪ o))
      (measurable_checkWeight reference (s ∪ o)) hso).symm
  rw [hZ]
  exact ENNReal.div_self (ne_of_gt (checkNormalizer_pos_on reference ha (s ∪ o) hRef x))
    (ne_top_of_le_ne_top ENNReal.one_ne_top (checkNormalizer_le_one reference (s ∪ o) x))

end HardSphere.Comparison

end

end OAI