math / data /lean /OAI /Probability /FreeIsing /Conditioning /CutLevelConditionalMean.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
9.1 kB
import OAI.Probability.FreeIsing.Estimates.BalancedLatentMean
import OAI.Probability.FreeIsing.Trees.NoisyCutLevelIndependence
namespace OAI
noncomputable section
open MeasureTheory ProbabilityTheory
open scoped ENNReal
namespace Problem367.RootedBroadcast
local instance cutLevelConditionalMeanMeasurableSingletonIsingSpin :
MeasurableSingletonClass IsingSpin := ⟨fun _ => trivial⟩
local instance cutLevelConditionalMeanIsProbabilityLabelMeasure (d : β„•) :
IsProbabilityMeasure (labelMeasure d) := by
unfold labelMeasure
infer_instance
theorem cutSpins_coordinate_fair {d : β„•} {theta : ℝ}
(h0 : -1 ≀ theta) (h1 : theta ≀ 1) (n : β„•) (c : TreeShell d n) (a : IsingSpin) :
((labelMeasure d).map (cutSpins theta n)) {s | s c = a} = (1 / 2 : ℝβ‰₯0∞) := by
rw [Measure.map_apply (measurable_cutSpins d theta n)
(measurableSet_eq_fun (measurable_pi_apply c) measurable_const)]
have h := (freeIsingMeasure_hasFreeIsingLaw d h0 h1).marginal c.1 a
rw [freeIsingMeasure, Measure.map_apply (measurable_factor d theta)
(measurableSet_eq_fun (measurable_pi_apply c.1) measurable_const)] at h
change (labelMeasure d) {U | factor theta U c.1 = a} = _
change (labelMeasure d) {U | factor theta U c.1 = a} = _ at h
simpa using h
theorem condExp_noisy_factor_cone_le_two_integral {d : β„•} {theta : ℝ} {A : Type*}
[MeasurableSpace A] [StandardBorelSpace A]
(h0 : -1 ≀ theta) (h1 : theta ≀ 1) (n : β„•)
(Ξ½ : TreeVertex d β†’ Measure A) [βˆ€ v, IsProbabilityMeasure (Ξ½ v)]
(c : TreeShell d n)
(F : (DescendantVertex c.1 β†’ IsingSpin) Γ— (DescendantVertex c.1 β†’ A) β†’ ℝ)
(hF : Measurable F) (hbound : βˆ€ p, 0 ≀ F p ∧ F p ≀ 1) :
βˆ€α΅ z βˆ‚(labelMeasure d).prod (Measure.infinitePi Ξ½),
(((labelMeasure d).prod (Measure.infinitePi Ξ½))[
(fun z : (TreeVertex d β†’ ℝ) Γ— (TreeVertex d β†’ A) =>
F ((fun v => factor theta z.1 v.1), fun v => z.2 v.1)) |
(inferInstance : MeasurableSpace (TreeShell d n β†’ IsingSpin)).comap
(fun z => cutSpins theta n z.1)]) z ≀
2 * ∫ w : (TreeVertex d β†’ ℝ) Γ— (TreeVertex d β†’ A),
F ((fun v => factor theta w.1 v.1), fun v => w.2 v.1)
βˆ‚(labelMeasure d).prod (Measure.infinitePi Ξ½) := by
let S := TreeShell d n β†’ IsingSpin
let R := (e : TreeShell d n) β†’
(StrictDescendantVertex e.1 β†’ ℝ) Γ— (DescendantVertex e.1 β†’ A)
let rho := (labelMeasure d).map (cutSpins theta n)
let muR := Measure.infinitePi (fun e : TreeShell d n =>
(Measure.infinitePi (fun _ : StrictDescendantVertex e.1 => uniform01)).prod
(Measure.infinitePi (fun v : DescendantVertex e.1 => Ξ½ v.1)))
let e : (TreeVertex d β†’ ℝ) Γ— (TreeVertex d β†’ A) β†’ S Γ— R :=
fun z => (cutSpins theta n z.1,
fun c => (cutLabels z.1 c, fun v => z.2 v.1))
have he : MeasurePreserving e ((labelMeasure d).prod (Measure.infinitePi Ξ½))
(rho.prod muR) :=
⟨((measurable_cutSpins d theta n).comp measurable_fst).prodMk
(by unfold cutLabels; fun_prop), map_cutSpins_cutLabels_noises theta n ν⟩
let G : IsingSpin Γ— R β†’ ℝ := fun p =>
F (coneFactor theta c.1 (p.1, (p.2 c).1), (p.2 c).2)
have hG : Measurable G :=
hF.comp (((measurable_coneFactor theta c.1).comp
(measurable_fst.prodMk
(measurable_fst.comp ((measurable_pi_apply c).comp measurable_snd)))).prodMk
(measurable_snd.comp ((measurable_pi_apply c).comp measurable_snd)))
have h := condExp_binary_channel_comp_le_two_integral
((labelMeasure d).prod (Measure.infinitePi Ξ½)) rho muR e he
(fun s : S => s c) (measurable_pi_apply c)
(cutSpins_coordinate_fair h0 h1 n c) G hG (fun p => hbound _)
have hfun : (fun z => G ((e z).1 c, (e z).2)) =
(fun z : (TreeVertex d β†’ ℝ) Γ— (TreeVertex d β†’ A) =>
F ((fun v => factor theta z.1 v.1), fun v => z.2 v.1)) := by
funext z
apply congrArg F
apply Prod.ext
Β· exact (factor_cone_representation theta c.1 z.1).symm
Β· rfl
rw [hfun] at h
exact h
end Problem367.RootedBroadcast
namespace Problem367
local instance cutLevelConditionalMeanFreeIsingMeasurableSingletonIsingSpin :
MeasurableSingletonClass IsingSpin := ⟨fun _ => trivial⟩
theorem freeIsingMeasure_condExp_cutLevel_observable_le_two_integral
{d : β„•} {theta : ℝ} {A : Type*}
[MeasurableSpace A] [StandardBorelSpace A]
(h0 : -1 ≀ theta) (h1 : theta ≀ 1) (n : β„•)
(Ξ½ : TreeVertex d β†’ Measure A) [βˆ€ v, IsProbabilityMeasure (Ξ½ v)]
(c : TreeShell d n)
(F : (RootedBroadcast.DescendantVertex c.1 β†’ IsingSpin) Γ—
(RootedBroadcast.DescendantVertex c.1 β†’ A) β†’ ℝ)
(hF : Measurable F) (hbound : βˆ€ p, 0 ≀ F p ∧ F p ≀ 1) :
βˆ€α΅ z βˆ‚(freeIsingMeasure d theta).prod (Measure.infinitePi Ξ½),
(((freeIsingMeasure d theta).prod (Measure.infinitePi Ξ½))[
(fun z : (TreeVertex d β†’ IsingSpin) Γ— (TreeVertex d β†’ A) =>
F ((fun v => z.1 v.1), fun v => z.2 v.1)) |
(inferInstance : MeasurableSpace (TreeShell d n β†’ IsingSpin)).comap
(fun z => fun e : TreeShell d n => z.1 e.1)]) z ≀
2 * ∫ w : (TreeVertex d β†’ IsingSpin) Γ— (TreeVertex d β†’ A),
F ((fun v => w.1 v.1), fun v => w.2 v.1)
βˆ‚(freeIsingMeasure d theta).prod (Measure.infinitePi Ξ½) := by
let : IsProbabilityMeasure (labelMeasure d) := by
unfold labelMeasure
infer_instance
let P := (freeIsingMeasure d theta).prod (Measure.infinitePi Ξ½)
let Q := (labelMeasure d).prod (Measure.infinitePi Ξ½)
let e : (TreeVertex d β†’ ℝ) Γ— (TreeVertex d β†’ A) β†’
(TreeVertex d β†’ IsingSpin) Γ— (TreeVertex d β†’ A) :=
Prod.map (RootedBroadcast.factor theta) id
let H : (TreeVertex d β†’ IsingSpin) Γ— (TreeVertex d β†’ A) β†’ ℝ :=
fun z => F ((fun v => z.1 v.1), fun v => z.2 v.1)
let S : (TreeVertex d β†’ IsingSpin) Γ— (TreeVertex d β†’ A) β†’
TreeShell d n β†’ IsingSpin := fun z c => z.1 c.1
have hS : Measurable S := by fun_prop
have hH : Measurable H := hF.comp (by fun_prop)
have hInt : Integrable H P := by
apply Integrable.of_bound hH.aestronglyMeasurable 1
exact Filter.Eventually.of_forall (fun z => by
rw [Real.norm_eq_abs, abs_of_nonneg (hbound _).1]
exact (hbound _).2)
have hf : MeasurePreserving (RootedBroadcast.factor theta)
(labelMeasure d) (freeIsingMeasure d theta) :=
⟨RootedBroadcast.measurable_factor d theta, rfl⟩
have he : MeasurePreserving e Q P := hf.prod (MeasurePreserving.id (Measure.infinitePi Ξ½))
have hpull := condExp_comp_measurePreserving Q P e he
((inferInstance : MeasurableSpace (TreeShell d n β†’ IsingSpin)).comap S)
hS.comap_le hInt
have hMean : (∫ x, H (e x) βˆ‚Q) = ∫ z, H z βˆ‚P := by
rw [← he.map_eq]
exact (integral_map he.measurable.aemeasurable hH.aestronglyMeasurable).symm
have hsource := RootedBroadcast.condExp_noisy_factor_cone_le_two_integral
h0 h1 n Ξ½ c F hF hbound
change βˆ€α΅ z βˆ‚P, (P[H | MeasurableSpace.comap S inferInstance]) z ≀
2 * ∫ w, H w βˆ‚P
have hgoal : βˆ€α΅ z βˆ‚Q.map e,
(P[H | MeasurableSpace.comap S inferInstance]) z ≀ 2 * ∫ w, H w βˆ‚P := by
apply (ae_map_iff he.measurable.aemeasurable
(measurableSet_le (stronglyMeasurable_condExp.mono hS.comap_le).measurable
measurable_const)).mpr
filter_upwards [hpull, hsource] with z hz hzbound
have hmeanbound : (Q[H ∘ e | (MeasurableSpace.comap S inferInstance).comap e]) z ≀
2 * ∫ x, H (e x) βˆ‚Q := by
simp only [MeasurableSpace.comap_comp, Function.comp_def, S, H, e,
Prod.map_fst, Prod.map_snd, id_eq]
exact hzbound
rw [hz, hMean] at hmeanbound
exact hmeanbound
simpa only [he.map_eq] using hgoal
theorem HasFreeIsingLaw.condExp_cutLevel_observable_le_two_integral
{d : β„•} {theta : ℝ} {A : Type*}
[MeasurableSpace A] [StandardBorelSpace A]
{ΞΌ : Measure (TreeVertex d β†’ IsingSpin)} [IsFiniteMeasure ΞΌ]
(hΞΌ : HasFreeIsingLaw theta ΞΌ) (h0 : -1 ≀ theta) (h1 : theta ≀ 1) (n : β„•)
(Ξ½ : TreeVertex d β†’ Measure A) [βˆ€ v, IsProbabilityMeasure (Ξ½ v)]
(c : TreeShell d n)
(F : (RootedBroadcast.DescendantVertex c.1 β†’ IsingSpin) Γ—
(RootedBroadcast.DescendantVertex c.1 β†’ A) β†’ ℝ)
(hF : Measurable F) (hbound : βˆ€ p, 0 ≀ F p ∧ F p ≀ 1) :
βˆ€α΅ z βˆ‚ΞΌ.prod (Measure.infinitePi Ξ½),
((ΞΌ.prod (Measure.infinitePi Ξ½))[
(fun z : (TreeVertex d β†’ IsingSpin) Γ— (TreeVertex d β†’ A) =>
F ((fun v => z.1 v.1), fun v => z.2 v.1)) |
(inferInstance : MeasurableSpace (TreeShell d n β†’ IsingSpin)).comap
(fun z => fun e : TreeShell d n => z.1 e.1)]) z ≀
2 * ∫ w : (TreeVertex d β†’ IsingSpin) Γ— (TreeVertex d β†’ A),
F ((fun v => w.1 v.1), fun v => w.2 v.1) βˆ‚ΞΌ.prod (Measure.infinitePi Ξ½) := by
have heq := hΞΌ.eq_freeIsingMeasure h0 h1
subst ΞΌ
exact freeIsingMeasure_condExp_cutLevel_observable_le_two_integral h0 h1 n Ξ½ c F hF hbound
end Problem367
end
end OAI