Download lean/OAI/Probability/PosteriorReplicas/Information/ParametricKernel.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 3.8 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/PosteriorReplicas/Information/ParametricKernel.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Probability/PosteriorReplicas/Information/ParametricKernel.lean
-
curl -L -o ParametricKernel.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/PosteriorReplicas/Information/ParametricKernel.lean
3.8 kB
Lean 4 · 9
declarations statementsfull
def parametricMapKernel (q : Measure U) (h : T × U → V) : Kernel T V := body · 1 line
(Kernel.id ×ₖ Kernel.const T q).map hinstance parametricMapKernel_sfinite (q : Measure U) [SFinite q]
(h : T × U → V) : IsSFiniteKernel (parametricMapKernel q h) := by body · 2 lines
unfold parametricMapKernel infer_instance
lemma parametricMapKernel_markov (q : Measure U) [IsProbabilityMeasure q]
(h : T × U → V) (hh : Measurable h) : IsMarkovKernel (parametricMapKernel q h) := proof · 1 line
Kernel.IsMarkovKernel.map _ hhlemma parametricMapKernel_apply (q : Measure U) [SFinite q]
{h : T × U → V} (hh : Measurable h) (t : T) :
parametricMapKernel q h t = q.map (fun u => h (t,u)) := by proof · 4 lines
rw [parametricMapKernel, Kernel.map_apply _ hh, Kernel.prod_apply,
Kernel.id_apply, Kernel.const_apply, Measure.dirac_prod,
Measure.map_map hh (by fun_prop)]
rfllemma compProd_parametricMapKernel (μ : Measure T) [SFinite μ] (q : Measure U) [SFinite q]
{h : T × U → V} (hh : Measurable h) :
μ ⊗ₘ parametricMapKernel q h = (μ.prod q).map (fun z => (z.1,h z)) := by proof · 7 lines
apply Measure.ext_of_lintegral
intro f hf
rw [Measure.lintegral_compProd hf, lintegral_map hf (by fun_prop),
lintegral_prod _ (by fun_prop)]
apply lintegral_congr
intro t
rw [parametricMapKernel_apply q hh, lintegral_map (by fun_prop) (by fun_prop)]def randomSideLaw (μ : Measure T) (g : T × X → Z) (q : Measure (X × Y)) :
Measure ((T × Z) × (X × Y)) := body · 1 line
(μ.prod q).map (fun z => ((z.1,g (z.1,z.2.1)),z.2))instance randomSideLaw_finite (μ : Measure T) [IsFiniteMeasure μ]
(g : T × X → Z) (q : Measure (X × Y)) [IsFiniteMeasure q] :
IsFiniteMeasure (randomSideLaw μ g q) := by unfold randomSideLaw; infer_instance lemma cmi_randomSideLaw (μ : Measure T) [IsFiniteMeasure μ]
{g : T × X → Z} (hg : Measurable g) (q : Measure (X × Y)) [IsProbabilityMeasure q] :
cmi (randomSideLaw μ g q) = ∫⁻ t, cmi (attachSide (fun x => g (t,x)) q) ∂μ := by proof · 13 lines
let h : T × (X × Y) → Z × (X × Y) := fun z => (g (z.1,z.2.1),z.2)
have hh : Measurable h := by fun_prop
let κ := parametricMapKernel q h
have : IsMarkovKernel κ := parametricMapKernel_markov q h hh
have he : (μ ⊗ₘ κ).map (MeasurableEquiv.prodAssoc.symm :
T × (Z × (X × Y)) ≃ᵐ (T × Z) × (X × Y)) = randomSideLaw μ g q := by
rw [compProd_parametricMapKernel μ q hh, Measure.map_map (by fun_prop) (by fun_prop)]
rfl
have ht (t : T) : κ t = attachSide (fun x => g (t,x)) q := by
rw [parametricMapKernel_apply q hh]
rfl
have hc := cmi_compProd_assoc μ κ
simpa only [he, ht] using hclemma measurable_cmi_attachSide {g : T × X → Z} (hg : Measurable g)
(q : Measure (X × Y)) [IsProbabilityMeasure q] :
Measurable (fun t => cmi (attachSide (fun x => g (t,x)) q)) := by proof · 8 lines
let h : T × (X × Y) → Z × (X × Y) := fun z => (g (z.1,z.2.1),z.2)
have hh : Measurable h := by fun_prop
let κ := parametricMapKernel q h
have : IsMarkovKernel κ := parametricMapKernel_markov q h hh
have ht (t : T) : κ t = attachSide (fun x => g (t,x)) q := by
rw [parametricMapKernel_apply q hh]
rfl
simpa only [ht] using cmi_kernel_measurable κOutline