Download lean/OAI/Probability/PosteriorReplicas/Information/StateSide.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 3.6 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/PosteriorReplicas/Information/StateSide.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Probability/PosteriorReplicas/Information/StateSide.lean
-
curl -L -o StateSide.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Probability/PosteriorReplicas/Information/StateSide.lean
3.6 kB
Lean 4 · 5
declarations statementsfull
def stateSideKernel {d k V W : ℕ} (ℓ : ℕ)
(q : Measure (Vec d × Fin V)) [IsFiniteMeasure q]
(κ : Kernel (Fin V × Data d k) (Fin W)) :
Kernel (Fin V) (Data d ℓ × (Vec d × Fin W)) := body · 2 lines
Kernel.ofFunOfCountable (fun v => randomSideLaw (haarRows d ℓ)
(fun z => labels z.1 z.2) (stateOutputKernel q κ v))instance {d k V W : ℕ} (ℓ : ℕ)
(q : Measure (Vec d × Fin V)) [IsProbabilityMeasure q]
(κ : Kernel (Fin V × Data d k) (Fin W)) [IsMarkovKernel κ] :
IsMarkovKernel (stateSideKernel ℓ q κ) where body · 4 lines
isProbabilityMeasure v := by
change IsProbabilityMeasure ((haarRows d ℓ).prod (stateOutputKernel q κ v) |>.map
(fun z => ((z.1,labels z.1 z.2.1),z.2)))
infer_instancelemma stateSideKernel_apply {d k V W : ℕ} (ℓ : ℕ)
(q : Measure (Vec d × Fin V)) [IsFiniteMeasure q]
(κ : Kernel (Fin V × Data d k) (Fin W)) (v : Fin V) :
stateSideKernel ℓ q κ v = randomSideLaw (haarRows d ℓ)
(fun z => labels z.1 z.2) (stateOutputKernel q κ v) := rfl lemma stateHaarSideLaw_eq_compProd {d ℓ k V W : ℕ}
(q : Measure (Vec d × Fin V)) [IsProbabilityMeasure q]
(κ : Kernel (Fin V × Data d k) (Fin W)) [IsMarkovKernel κ] :
stateHaarSideLaw ℓ (stateMessageLaw q κ) =
(q.snd ⊗ₘ stateSideKernel ℓ q κ).map
(MeasurableEquiv.prodAssoc.symm :
Fin V × (Data d ℓ × (Vec d × Fin W)) ≃ᵐ
(Fin V × Data d ℓ) × (Vec d × Fin W)) := by proof · 25 lines
apply Measure.ext_of_lintegral
intro g hg
let F : Rows d ℓ × Fin V → ℝ≥0∞ := fun z =>
∫⁻ sw, g ((z.2,(z.1,labels z.1 sw.1)),sw) ∂stateOutputKernel q κ z.2
have hF : Measurable F := by
exact (show Measurable (fun z : (Rows d ℓ × Fin V) × (Vec d × Fin W) =>
g ((z.1.2,(z.1.1,labels z.1.1 z.2.1)),z.2)) by unfold labels; fun_prop).lintegral_kernel_prod_right'
(κ := (stateOutputKernel q κ).comap Prod.snd measurable_snd)
rw [stateHaarSideLaw,lintegral_map hg (by unfold labels; fun_prop),
lintegral_prod _ (by unfold labels; fun_prop),
lintegral_map hg (by fun_prop),Measure.lintegral_compProd (by fun_prop)]
calc
_ = ∫⁻ B, ∫⁻ v, F (B,v) ∂q.snd ∂haarRows d ℓ := by
apply lintegral_congr
intro B
rw [stateMessageLaw_eq_compProd,lintegral_map (by unfold labels; fun_prop) (by fun_prop),
Measure.lintegral_compProd (by unfold labels; fun_prop)]
_ = ∫⁻ v, ∫⁻ B, F (B,v) ∂haarRows d ℓ ∂q.snd :=
lintegral_lintegral_swap hF.aemeasurable
_ = _ := by
apply lintegral_congr
intro v
rw [stateSideKernel_apply,randomSideLaw,lintegral_map (by fun_prop) (by unfold labels; fun_prop),
lintegral_prod _ (by unfold labels; fun_prop)]
rfllemma stateHaarInformation_average {d ℓ k V W : ℕ} [NeZero W]
(hℓ : ℓ ≤ d) (q : Measure (Vec d × Fin V)) [IsProbabilityMeasure q]
(κ : Kernel (Fin V × Data d k) (Fin W)) [IsMarkovKernel κ] :
cmi (stateHaarSideLaw ℓ (stateMessageLaw q κ)) =
∑ v, q.snd {v} * conditionalInformation (sideLaw ℓ (stateOutputKernel q κ v)) := by proof · 5 lines
simp only [stateHaarSideLaw_eq_compProd]
rw [cmi_compProd_assoc,lintegral_fintype]
apply Finset.sum_congr rfl
intro v _
simp only [stateSideKernel_apply,cmi_haar_eq_gaussian hℓ,mul_comm]Outline