Download data/lean/OAI/Probability/FreeIsing/Conditioning/CutLevelConditionalMean.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.1 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Conditioning/CutLevelConditionalMean.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/FreeIsing/Conditioning/CutLevelConditionalMean.lean
-
curl -L -o CutLevelConditionalMean.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Conditioning/CutLevelConditionalMean.lean
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 | |