cfahlgren1/math / lean /OAI /Probability /FreeIsing /Trees /NoisyRootIndependence.lean
cfahlgren1's picture
download
raw
8.79 kB
import OAI.Probability.FreeIsing.Conditioning.Descent
import OAI.Probability.FreeIsing.Posterior.LatentObservationIndependence
import OAI.Probability.FreeIsing.Trees.NoisyBranchIndependence
namespace OAI
noncomputable section
open MeasureTheory ProbabilityTheory
namespace Problem367
namespace RootedBroadcast
local instance : MeasurableSingletonClass IsingSpin := ⟨fun _ => trivial⟩
theorem map_root_ownNoise_branch_family {d : ℕ} {A : Type*}
[MeasurableSpace A] (ν : TreeVertex d → Measure A)
[∀ v, IsProbabilityMeasure (ν v)] :
(Measure.infinitePi (fun v => uniform01.prod (ν v))).map
(fun U : TreeVertex d → ℝ × A =>
(fairSpin (U (root d)).1, (U (root d)).2,
fun c : Fin d => fun v : BranchVertex c => U v.val)) =
(uniform01.map fairSpin).prod ((ν (root d)).prod
(Measure.infinitePi (fun c : Fin d =>
Measure.infinitePi (fun v : BranchVertex c => uniform01.prod (ν v.val))))) := by
have hbase := map_root_branch_family_of_sampler
(fun v => uniform01.prod (ν v))
(fun p : ℝ × A => (fairSpin p.1, p.2))
((measurable_fairSpin.comp measurable_fst).prodMk measurable_snd)
have hroot : (uniform01.prod (ν (root d))).map
(fun p : ℝ × A => (fairSpin p.1, p.2)) =
(uniform01.map fairSpin).prod (ν (root d)) := by
change (uniform01.prod (ν (root d))).map (Prod.map fairSpin id) = _
rw [← Measure.map_prod_map _ _ measurable_fairSpin measurable_id, Measure.map_id]
rw [hroot] at hbase
calc
_ = ((Measure.infinitePi (fun v => uniform01.prod (ν v))).map
(fun U : TreeVertex d → ℝ × A =>
((fairSpin (U (root d)).1, (U (root d)).2),
fun c : Fin d => fun v : BranchVertex c => U v.val))).map
MeasurableEquiv.prodAssoc := by
have hmf : Measurable (fun U : TreeVertex d → ℝ × A => fairSpin (U (root d)).1) :=
(measurable_fairSpin.comp measurable_fst).comp (measurable_pi_apply (root d))
have hm : Measurable (fun U : TreeVertex d → ℝ × A =>
((fairSpin (U (root d)).1, (U (root d)).2),
fun c : Fin d => fun v : BranchVertex c => U v.val)) :=
(hmf.prodMk (by fun_prop)).prodMk (by fun_prop)
rw [Measure.map_map (by fun_prop) hm]
rfl
_ = _ := by
rw [hbase]
exact (measurePreserving_prodAssoc (uniform01.map fairSpin) (ν (root d))
(Measure.infinitePi (fun c : Fin d =>
Measure.infinitePi (fun v : BranchVertex c => uniform01.prod (ν v.val))))).map_eq
theorem condIndepFun_noisy_factor_root_branches {d : ℕ} {A : Type*}
[MeasurableSpace A] [StandardBorelSpace A]
(theta : ℝ) (ν : TreeVertex d → Measure A)
[∀ v, IsProbabilityMeasure (ν v)] :
CondIndepFun
((inferInstance : MeasurableSpace IsingSpin).comap
(fun U : TreeVertex d → ℝ × A => fairSpin (U (root d)).1))
((measurable_fairSpin.comp measurable_fst).comp
(measurable_pi_apply (root d))).comap_le
(fun U => (fairSpin (U (root d)).1, (U (root d)).2))
(fun U => fun c : Fin d =>
((fun v : BranchVertex c => factor theta (fun w => (U w).1) v.val),
fun v : BranchVertex c => (U v.val).2))
(Measure.infinitePi (fun v => uniform01.prod (ν v))) := by
let G : IsingSpin × (∀ c : Fin d, BranchVertex c → ℝ × A) →
(∀ c : Fin d, (BranchVertex c → IsingSpin) × (BranchVertex c → A)) :=
fun p c => (branchFactor theta c (p.1, fun v => (p.2 c v).1),
fun v => (p.2 c v).2)
have hG : Measurable G := by
apply Measurable.of_eval
intro c
exact ((measurable_branchFactor theta c).comp
(measurable_fst.prodMk (by fun_prop))).prodMk (by fun_prop)
have h := condIndepFun_of_product_jointLaw
(Measure.infinitePi (fun v => uniform01.prod (ν v)))
(uniform01.map fairSpin) (ν (root d))
(Measure.infinitePi (fun c : Fin d =>
Measure.infinitePi (fun v : BranchVertex c => uniform01.prod (ν v.val))))
((measurable_fairSpin.comp measurable_fst).comp (measurable_pi_apply (root d)))
(measurable_snd.comp (measurable_pi_apply (root d)))
(show Measurable (fun U : TreeVertex d → ℝ × A =>
fun c : Fin d => fun v : BranchVertex c => U v.val) from by fun_prop)
(map_root_ownNoise_branch_family ν) id G measurable_id hG
have hfun : (fun U : TreeVertex d → ℝ × A =>
G (fairSpin (U (root d)).1, fun c v => U v.val)) =
(fun U => fun c : Fin d =>
((fun v : BranchVertex c => factor theta (fun w => (U w).1) v.val),
fun v : BranchVertex c => (U v.val).2)) := by
funext U c
apply Prod.ext
· exact (factor_branch_representation theta c (fun w => (U w).1)).symm
· rfl
simpa only [Function.comp_def, id_eq, hfun] using h
end RootedBroadcast
local instance : MeasurableSingletonClass IsingSpin := ⟨fun _ => trivial⟩
theorem freeIsingMeasure_condIndepFun_noisy_root_branches {d : ℕ} {A : Type*}
[MeasurableSpace A] [StandardBorelSpace A]
(theta : ℝ) (ν : TreeVertex d → Measure A)
[∀ v, IsProbabilityMeasure (ν v)] :
CondIndepFun
((inferInstance : MeasurableSpace IsingSpin).comap
(fun z : (TreeVertex d → IsingSpin) × (TreeVertex d → A) =>
z.1 (RootedBroadcast.root d)))
((measurable_pi_apply (RootedBroadcast.root d)).comp measurable_fst).comap_le
(fun z => (z.1 (RootedBroadcast.root d), z.2 (RootedBroadcast.root d)))
(fun z => fun c : Fin d =>
((fun v : RootedBroadcast.BranchVertex c => z.1 v.val),
fun v : RootedBroadcast.BranchVertex c => z.2 v.val))
((freeIsingMeasure d theta).prod (Measure.infinitePi ν)) := by
let e : (TreeVertex d → ℝ × A) →
(TreeVertex d → IsingSpin) × (TreeVertex d → A) :=
fun U => (RootedBroadcast.factor theta (fun v => (U v).1), fun v => (U v).2)
have he : MeasurePreserving e (Measure.infinitePi (fun v => uniform01.prod (ν v)))
((freeIsingMeasure d theta).prod (Measure.infinitePi ν)) :=
⟨((RootedBroadcast.measurable_factor d theta).comp (by fun_prop)).prodMk
(by fun_prop), RootedBroadcast.map_noisyBroadcast theta ν⟩
apply condIndepFun_of_comp_measurePreserving
(Measure.infinitePi (fun v => uniform01.prod (ν v)))
((freeIsingMeasure d theta).prod (Measure.infinitePi ν)) e he
((inferInstance : MeasurableSpace IsingSpin).comap
(fun z : (TreeVertex d → IsingSpin) × (TreeVertex d → A) =>
z.1 (RootedBroadcast.root d)))
((measurable_pi_apply (RootedBroadcast.root d)).comp measurable_fst).comap_le
(show Measurable (fun z : (TreeVertex d → IsingSpin) × (TreeVertex d → A) =>
(z.1 (RootedBroadcast.root d), z.2 (RootedBroadcast.root d))) from by fun_prop)
(show Measurable (fun z : (TreeVertex d → IsingSpin) × (TreeVertex d → A) =>
fun c : Fin d => ((fun v : RootedBroadcast.BranchVertex c => z.1 v.val),
fun v : RootedBroadcast.BranchVertex c => z.2 v.val)) from by fun_prop)
have hroot (U : TreeVertex d → ℝ × A) :
RootedBroadcast.factor theta (fun v => (U v).1) (RootedBroadcast.root d) =
fairSpin (U (RootedBroadcast.root d)).1 := by
simp [RootedBroadcast.factor, RootedBroadcast.root,
RootedBroadcast.ofNoise_root, RootedBroadcast.inputNoise]
simpa only [MeasurableSpace.comap_comp, Function.comp_def, e, hroot] using
RootedBroadcast.condIndepFun_noisy_factor_root_branches theta ν
theorem HasFreeIsingLaw.condIndepFun_root_branch_observables
{d : ℕ} {theta : ℝ} {A C D : Type*}
[MeasurableSpace A] [StandardBorelSpace A]
[MeasurableSpace C] [MeasurableSpace D]
{μ : Measure (TreeVertex d → IsingSpin)} [IsFiniteMeasure μ]
(hμ : HasFreeIsingLaw theta μ) (h0 : -1 ≤ theta) (h1 : theta ≤ 1)
(ν : TreeVertex d → Measure A) [∀ v, IsProbabilityMeasure (ν v)]
(F : IsingSpin × A → C)
(G : (∀ c : Fin d, (RootedBroadcast.BranchVertex c → IsingSpin) ×
(RootedBroadcast.BranchVertex c → A)) → D)
(hF : Measurable F) (hG : Measurable G) :
CondIndepFun
((inferInstance : MeasurableSpace IsingSpin).comap
(fun z : (TreeVertex d → IsingSpin) × (TreeVertex d → A) =>
z.1 (RootedBroadcast.root d)))
((measurable_pi_apply (RootedBroadcast.root d)).comp measurable_fst).comap_le
(fun z => F (z.1 (RootedBroadcast.root d), z.2 (RootedBroadcast.root d)))
(fun z => G (fun c : Fin d =>
((fun v : RootedBroadcast.BranchVertex c => z.1 v.val),
fun v : RootedBroadcast.BranchVertex c => z.2 v.val)))
(μ.prod (Measure.infinitePi ν)) := by
have heq := hμ.eq_freeIsingMeasure h0 h1
subst μ
exact (freeIsingMeasure_condIndepFun_noisy_root_branches theta ν).comp hF hG
end Problem367
end
end OAI

Xet Storage Details

Size:
8.79 kB
·
Xet hash:
d9a6d0f0cbb60e771bc1d7348388478a7fe44793041a5d15535c2f3b980ac02f

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.