File size: 8,650 Bytes
f61e547 | 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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | import OAI.Probability.FreeIsing.Spins.ObservationFusion
namespace OAI
noncomputable section
open MeasureTheory ProbabilityTheory
namespace Problem367
section Observations
variable {Ω A B : Type*} {mΩ : MeasurableSpace Ω} {mA : MeasurableSpace A}
{mB : MeasurableSpace B} {rho : Measure Ω} [IsProbabilityMeasure rho]
{S : Ω → IsingSpin} (hS : Measurable S)
{X : Ω → A} {Y : Ω → B} (hX : Measurable X) (hY : Measurable Y)
{q : A → ℝ} {r : B → ℝ} (hq : Measurable q) (hr : Measurable r)
(hpostX : rho[fun x => spinSign (S x) | mA.comap X] =ᵐ[rho] fun x => q (X x))
(hpostY : rho[fun x => spinSign (S x) | mB.comap Y] =ᵐ[rho] fun x => r (Y x))
(hqb : ∀ᵐ x ∂rho, |q (X x)| < 1) (hrb : ∀ᵐ x ∂rho, |r (Y x)| < 1)
(hfair : ∀ a : IsingSpin, rho {x | S x = a} = (1 / 2 : ENNReal))
(hInd : ∀ a : IsingSpin, IndepFun X Y (cond rho {x | S x = a}))
include hS hX hY hq hr hpostX hpostY hqb hrb hfair hInd
theorem map_observation_posterior_pair_eq_binaryFusionJointLaw :
Measure.map (fun x => (q (X x), r (Y x))) rho =
binaryFusionJointLaw (Measure.map (fun x => q (X x)) rho)
(Measure.map (fun x => r (Y x)) rho) := by
have hL : ∀ᵐ x ∂rho, |rho[fun y => spinSign (S y) | mA.comap X] x| < 1 := by
filter_upwards [hpostX, hqb] with x hx hb
simpa only [hx] using hb
have hR : ∀ᵐ x ∂rho, |rho[fun y => spinSign (S y) | mB.comap Y] x| < 1 := by
filter_upwards [hpostY, hrb] with x hx hb
simpa only [hx] using hb
have hInd' (a : IsingSpin) :
IndepFun (rho[fun y => spinSign (S y) | mA.comap X])
(rho[fun y => spinSign (S y) | mB.comap Y]) (cond rho {x | S x = a}) :=
((hInd a).comp hq hr).congr
(cond_absolutelyContinuous.ae_le hpostX.symm)
(cond_absolutelyContinuous.ae_le hpostY.symm)
have hjoint := map_posterior_pair_eq_binaryFusionJointLaw
hX.comap_le hY.comap_le hS hfair hInd' hL hR
have hp : (fun x => (rho[fun y => spinSign (S y) | mA.comap X] x,
rho[fun y => spinSign (S y) | mB.comap Y] x)) =ᵐ[rho]
(fun x => (q (X x), r (Y x))) := by
filter_upwards [hpostX, hpostY] with x hx hy
rw [hx, hy]
rw [Measure.map_congr hp, Measure.map_congr hpostX, Measure.map_congr hpostY] at hjoint
exact hjoint
theorem condExp_observation_pair_map_eq_binaryFusion :
Measure.map (rho[fun x => spinSign (S x) |
(inferInstance : MeasurableSpace (A × B)).comap (fun x => (X x, Y x))]) rho =
Measure.map (fun p : ℝ × ℝ => binaryFusion p.1 p.2)
(binaryFusionJointLaw (Measure.map (fun x => q (X x)) rho)
(Measure.map (fun x => r (Y x)) rho)) := by
have hCE := condExp_spin_given_observation_pair_eq_binaryFusion
hS hX hY hq hr hpostX hpostY hqb hrb hfair hInd
rw [Measure.map_congr hCE,
← map_observation_posterior_pair_eq_binaryFusionJointLaw
hS hX hY hq hr hpostX hpostY hqb hrb hfair hInd,
Measure.map_map (show Measurable (fun p : ℝ × ℝ => binaryFusion p.1 p.2) by
unfold binaryFusion; fun_prop) (show Measurable (fun x => (q (X x), r (Y x))) from
(hq.comp hX).prodMk (hr.comp hY))]
rfl
theorem condExp_observation_pair_secondMoment
(hsym : Measure.map (fun u : ℝ => -u)
(Measure.map (fun x => r (Y x)) rho) = Measure.map (fun x => r (Y x)) rho) :
(∫ x, (rho[fun x => spinSign (S x) |
(inferInstance : MeasurableSpace (A × B)).comap (fun x => (X x, Y x))] x) ^ 2 ∂rho) =
(∫ x, q (X x) ^ 2 ∂rho) + (∫ x, r (Y x) ^ 2 ∂rho) -
∫ p : ℝ × ℝ, binaryFusionLoss p.1 p.2 ∂
(Measure.map (fun x => q (X x)) rho).prod (Measure.map (fun x => r (Y x)) rho) := by
have hCE := condExp_spin_given_observation_pair_eq_binaryFusion
hS hX hY hq hr hpostX hpostY hqb hrb hfair hInd
have hiCE := integral_congr_ae (hCE.fun_comp (fun x : ℝ => x ^ 2))
simp only [Function.comp_apply] at hiCE
rw [hiCE]
have hpair : Measurable (fun x => (q (X x), r (Y x))) :=
(hq.comp hX).prodMk (hr.comp hY)
have hmap := integral_map (μ := rho) hpair.aemeasurable
(show AEStronglyMeasurable (fun p : ℝ × ℝ => binaryFusion p.1 p.2 ^ 2) _ by
apply Measurable.aestronglyMeasurable; unfold binaryFusion; fun_prop)
rw [map_observation_posterior_pair_eq_binaryFusionJointLaw
hS hX hY hq hr hpostX hpostY hqb hrb hfair hInd] at hmap
rw [← hmap]
have hqm : ∀ᵐ u ∂Measure.map (fun x => q (X x)) rho, |u| < 1 :=
(ae_map_iff (hq.comp hX).aemeasurable
(measurableSet_lt measurable_abs measurable_const)).2 hqb
have hrm : ∀ᵐ u ∂Measure.map (fun x => r (Y x)) rho, |u| < 1 :=
(ae_map_iff (hr.comp hY).aemeasurable
(measurableSet_lt measurable_abs measurable_const)).2 hrb
rw [binaryFusionJointLaw_secondMoment hqm hrm hsym,
integral_map (μ := rho) (φ := fun x => q (X x)) (f := fun u : ℝ => u ^ 2)
(hq.comp hX).aemeasurable (by fun_prop),
integral_map (μ := rho) (φ := fun x => r (Y x)) (f := fun u : ℝ => u ^ 2)
(hr.comp hY).aemeasurable (by fun_prop)]
theorem condExp_observation_pair_secondMoment_le_add
(hsym : Measure.map (fun u : ℝ => -u)
(Measure.map (fun x => r (Y x)) rho) = Measure.map (fun x => r (Y x)) rho) :
(∫ x, (rho[fun x => spinSign (S x) |
(inferInstance : MeasurableSpace (A × B)).comap (fun x => (X x, Y x))] x) ^ 2 ∂rho) ≤
(∫ x, q (X x) ^ 2 ∂rho) + (∫ x, r (Y x) ^ 2 ∂rho) := by
rw [condExp_observation_pair_secondMoment
hS hX hY hq hr hpostX hpostY hqb hrb hfair hInd hsym]
apply sub_le_self
apply integral_binaryFusionLoss_nonneg
· exact (ae_map_iff (hq.comp hX).aemeasurable
(measurableSet_lt measurable_abs measurable_const)).2 hqb
· exact (ae_map_iff (hr.comp hY).aemeasurable
(measurableSet_lt measurable_abs measurable_const)).2 hrb
theorem condExp_observation_pair_abs_lt_one :
∀ᵐ x ∂rho, |rho[fun x => spinSign (S x) |
(inferInstance : MeasurableSpace (A × B)).comap (fun x => (X x, Y x))] x| < 1 := by
have hCE := condExp_spin_given_observation_pair_eq_binaryFusion
hS hX hY hq hr hpostX hpostY hqb hrb hfair hInd
filter_upwards [hCE, hqb, hrb] with x hx hqx hrx
rw [hx]
exact abs_binaryFusion_lt_one hqx hrx
theorem condExp_observation_pair_neg_invariant
(hsymq : Measure.map (fun u : ℝ => -u)
(Measure.map (fun x => q (X x)) rho) = Measure.map (fun x => q (X x)) rho)
(hsymr : Measure.map (fun u : ℝ => -u)
(Measure.map (fun x => r (Y x)) rho) = Measure.map (fun x => r (Y x)) rho) :
Measure.map (fun u : ℝ => -u)
(Measure.map (rho[fun x => spinSign (S x) |
(inferInstance : MeasurableSpace (A × B)).comap (fun x => (X x, Y x))]) rho) =
Measure.map (rho[fun x => spinSign (S x) |
(inferInstance : MeasurableSpace (A × B)).comap (fun x => (X x, Y x))]) rho := by
rw [condExp_observation_pair_map_eq_binaryFusion
hS hX hY hq hr hpostX hpostY hqb hrb hfair hInd]
exact binaryFusion_map_neg_invariant hsymq hsymr
omit hqb hrb in
theorem condExp_observation_pair_secondMoment_le
{theta : ℝ}
(hqtheta : ∀ᵐ x ∂rho, |q (X x)| ≤ theta)
(hrtheta : ∀ᵐ x ∂rho, |r (Y x)| ≤ theta) (htheta : theta < 1)
(hsym : Measure.map (fun u : ℝ => -u)
(Measure.map (fun x => r (Y x)) rho) = Measure.map (fun x => r (Y x)) rho) :
(∫ x, (rho[fun x => spinSign (S x) |
(inferInstance : MeasurableSpace (A × B)).comap (fun x => (X x, Y x))] x) ^ 2 ∂rho) ≤
(∫ x, q (X x) ^ 2 ∂rho) + (∫ x, r (Y x) ^ 2 ∂rho) -
2 * (1 - theta ^ 2) * (∫ x, q (X x) ^ 2 ∂rho) * (∫ x, r (Y x) ^ 2 ∂rho) := by
have hq1 := hqtheta.mono (fun _ hx => lt_of_le_of_lt hx htheta)
have hr1 := hrtheta.mono (fun _ hx => lt_of_le_of_lt hx htheta)
rw [condExp_observation_pair_secondMoment
hS hX hY hq hr hpostX hpostY hq1 hr1 hfair hInd hsym]
have hqm : ∀ᵐ u ∂Measure.map (fun x => q (X x)) rho, |u| ≤ theta :=
(ae_map_iff (hq.comp hX).aemeasurable
(measurableSet_le measurable_abs measurable_const)).2 hqtheta
have hrm : ∀ᵐ u ∂Measure.map (fun x => r (Y x)) rho, |u| ≤ theta :=
(ae_map_iff (hr.comp hY).aemeasurable
(measurableSet_le measurable_abs measurable_const)).2 hrtheta
have hloss := integral_binaryFusionLoss_lower_bound hqm hrm htheta
rw [integral_map (μ := rho) (φ := fun x => q (X x)) (f := fun u : ℝ => u ^ 2)
(hq.comp hX).aemeasurable (by fun_prop),
integral_map (μ := rho) (φ := fun x => r (Y x)) (f := fun u : ℝ => u ^ 2)
(hr.comp hY).aemeasurable (by fun_prop)] at hloss
exact sub_le_sub_left hloss _
end Observations
end Problem367
end
end OAI
|