File size: 3,063 Bytes
b317718
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Probability.FreeIsing.Posterior.LatentObservationIndependence
import OAI.Probability.FreeIsing.Trees.BroadcastBranchLabels
import OAI.Probability.FreeIsing.Trees.BroadcastJointLaw

namespace OAI

noncomputable section
open MeasureTheory ProbabilityTheory

namespace Problem367.RootedBroadcast

local instance : MeasurableSingletonClass IsingSpin := ⟨fun _ => trivial⟩

local instance (d : ℕ) : IsProbabilityMeasure (labelMeasure d) := by
  unfold labelMeasure
  infer_instance

theorem map_factor_disjoint_blocks {d : ℕ} (theta : ℝ) (v : TreeVertex d)
    (S T : Set (NonrootVertex d)) (hST : Disjoint S T) :
    (labelMeasure d).map (fun U => (factor theta U v,
      (fun i : S => U i.val.val), (fun i : T => U i.val.val))) =
      (uniform01.map fairSpin).prod
        ((Measure.infinitePi (fun _ : S => uniform01)).prod
          (Measure.infinitePi (fun _ : T => uniform01))) := by
  let H : (NonrootVertex d → ℝ) → (S → ℝ) × (T → ℝ) :=
    fun Y => ((fun i => Y i.val), (fun i => Y i.val))
  have hH : Measurable H := by fun_prop
  have hJ : Measurable (fun U : TreeVertex d → ℝ =>
      (factor theta U v, fun w : NonrootVertex d => U w.val)) :=
    ((measurable_pi_apply v).comp (measurable_factor d theta)).prodMk
      (Measurable.of_eval (fun vertex => measurable_pi_apply vertex.val))
  have hmap : (Measure.infinitePi (fun _ : NonrootVertex d => uniform01)).map H =
      (Measure.infinitePi (fun _ : S => uniform01)).prod
        (Measure.infinitePi (fun _ : T => uniform01)) :=
    map_disjoint_subarrays (fun _ : NonrootVertex d => uniform01) S T hST
  calc
    _ = ((labelMeasure d).map (fun U =>
        (factor theta U v, fun w : NonrootVertex d => U w.val))).map (Prod.map id H) := by
      rw [Measure.map_map (measurable_id.prodMap hH) hJ]
      rfl
    _ = _ := by
      rw [map_factor_rest]
      rw [← Measure.map_prod_map _ _ measurable_id hH]
      rw [Measure.map_id, hmap]

theorem condIndepFun_factor_disjoint_blocks {d : ℕ} (theta : ℝ) (v : TreeVertex d)
    (S T : Set (NonrootVertex d)) (hST : Disjoint S T)
    {A B : Type*} [MeasurableSpace A] [MeasurableSpace B]
    (F : IsingSpin × (S → ℝ) → A) (G : IsingSpin × (T → ℝ) → B)
    (hF : Measurable F) (hG : Measurable G) :
    CondIndepFun (MeasurableSpace.comap (fun U => factor theta U v) inferInstance)
      (((measurable_pi_apply v).comp (measurable_factor d theta)).comap_le)
      (fun U => F (factor theta U v, fun i : S => U i.val.val))
      (fun U => G (factor theta U v, fun i : T => U i.val.val))
      (labelMeasure d) := by
  let : IsProbabilityMeasure (labelMeasure d) := by
    unfold labelMeasure
    infer_instance
  exact condIndepFun_of_product_jointLaw (labelMeasure d) (uniform01.map fairSpin)
    (Measure.infinitePi (fun _ : S => uniform01))
    (Measure.infinitePi (fun _ : T => uniform01))
    ((measurable_pi_apply v).comp (measurable_factor d theta))
    (by fun_prop) (by fun_prop) (map_factor_disjoint_blocks theta v S T hST)
    F G hF hG

end Problem367.RootedBroadcast

end

end OAI