Cslib.Probability.PMF.posteriorDist_eq_prior_of_outputIndist
theoremverifiedformalizationimported Lean
If the output distribution of a channel does not depend on the input, then conditioning on any output with positive probability leaves the prior unchanged.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open ENNReal in universe u v in variable {α : Type u} {β : Type v} in theorem Cslib.Probability.PMF.posteriorDist_eq_prior_of_outputIndist (p : PMF α) (f : α → PMF β) (h : ∀ a₀ a₁ : α, f a₀ = f a₁) (b : β) (hb : b ∈ (p.bind f).support) : posteriorDist p f b hb = p
- Formalizes
- CSLib, `Cslib.Probability.PMF.posteriorDist_eq_prior_of_outputIndist`
- Lean proof
- By Samuel Schlesinger, from github.com/leanprover/cslib at
3951377e5a3f(Copyright (c) 2026 Samuel Schlesinger. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.Cslib.Probability.PMF.posteriorDist_eq_prior_of_outputIndist← Cslib.Probability.PMF.posteriorDist_eq_prior_of_outputIndist (Cslib/Probability/PMF.lean:116): verbatim
- Verified
- 08 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 3
- Cslib.Probability.PMF.posteriorDist_applyCslib.Probability.PMF.posteriorDist_apply
- Cslib.Probability.PMF.bind_pair_applyEvaluating the "pairing" bind
(do let a ← p; return (a, ← f a))at(a, b)gives the productp a * f a b. - Cslib.Probability.PMF.posteriorDistThe posterior distribution
Pr[A = a | B = b]as aPMF, givena ← p,b ← f a, and thatbhas positive marginal probability.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
set_option autoImplicit true inset_option relaxedAutoImplicit true inopen ENNReal inuniverse u v invariable {α : Type u} {β : Type v} in/-- If the output distribution of a channel does not depend on the input, then conditioning on any output with positive probability leaves the prior unchanged. -/theorem Cslib.Probability.PMF.posteriorDist_eq_prior_of_outputIndist (p : PMF α) (f : α → PMF β) (h : ∀ a₀ a₁ : α, f a₀ = f a₁) (b : β) (hb : b ∈ (p.bind f).support) : posteriorDist p f b hb = p := by ext a rw [posteriorDist_apply, bind_pair_apply, PMF.bind_apply] have hf : ∀ a', f a' b = f a b := fun a' => by rw [h a' a] simp_rw [hf] rw [ENNReal.tsum_mul_right, PMF.tsum_coe, one_mul] have hb' : (p.bind f) b ≠ 0 := (PMF.mem_support_iff _ _).mp hb have hmarg : (p.bind f) b = f a b := by rw [PMF.bind_apply] simp_rw [hf] rw [ENNReal.tsum_mul_right, PMF.tsum_coe, one_mul] exact ENNReal.mul_div_cancel_right (hmarg ▸ hb') (ne_top_of_le_ne_top ENNReal.one_ne_top (PMF.coe_le_one _ _))