AFTD Auto-Formalizing Theoretical Domains

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.
Verified
08 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 3

Lean source view module on GitHub

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 _ _))
See it in the graphDiscuss this resultChallenge it