Support Analysis for Sub-Distributions #
This file provides key lemmas for extracting support information from
sub-distribution operations, particularly SDistr.bind.
Main results #
SDistr.bind_support_witness- If(d.bind f)(some b) ≠ 0, then there exists an intermediate valueawithd(some a) ≠ 0and(f a)(some b) ≠ 0.tsum_option_split- Split a sum overOption αinto thenoneterm plus the sum oversometerms.tsum_some_eq_mass- The sum oversomeoutcomes equals the mass.
Motivation #
These lemmas are the foundation for the unary probabilistic Hoare logic (pHL)
proof rules, particularly pHoare_bind and pHoare_sample. They extract
existential witnesses from nonzero probability observations.
References #
- EasyCrypt: support analysis in pRHL
rndtactic - CertiCrypt (Barthe et al.): coupling and support reasoning in Coq
Splitting sums over Option #
Bind support witness #
theorem
CatCrypt.Prob.SDistr.bind_support_witness
{α : Type u_1}
{β : Type u_2}
{d : SDistr α}
{f : α → SDistr β}
{b : β}
(h : (d.bind f) (some b) ≠ 0)
:
Key lemma: If (d.bind f)(some b) ≠ 0, then there exists an intermediate
value a such that d(some a) ≠ 0 and (f a)(some b) ≠ 0.
This extracts a witness from the nonzero probability of a bind result.
The proof uses the contrapositive of ENNReal.tsum_eq_zero:
if the sum ∑ oa, d(oa) * (cont oa)(some b) is nonzero,
at least one term must be nonzero.
Proof sketch:
SDistr.bindisPMF.bindwith failure propagationPMF.bind_applygives(d.bind f)(some b) = ∑' oa, d(oa) * (cont oa)(some b)- If this sum ≠ 0, by contrapositive of
tsum_eq_zero, ∃ oa with term ≠ 0 - That term is
d(oa) * (cont oa)(some b) ≠ 0, so both factors ≠ 0 oacannot benone(since cont of none isfail, giving 0)- So
oa = some afor somea, giving our witness