Independent products of sub-distributions #
prod d₁ d₂ is the distribution of an independent pair: sample d₁, sample d₂,
return both. piFin ds is the finite indexed product — one independent draw per
index of Fin n, returned as a function.
Main definitions #
prod d₁ d₂— the independent product of two sub-distributionspiFin ds— the independent product of aFin n-indexed familyreplicateFin n d—piFinof the constant family,nindependent draws from one sub-distribution
Main results #
mass_bind_of_mass_one— a bind of total distributions is totalmass_prod,mass_piFin,mass_replicateFin— a product of total distributions is totalprod_bind_fst,prod_bind_snd— the two marginals of a product, when the discarded factor is total
Correspondence with EasyCrypt #
prod is the image of EasyCrypt's (`*`) of the Distr theory, whose
definition dprod_dlet gives as dlet da (fun a => dmap db (fun b => (a, b))) —
the bind form prod is defined by.
Mass of a bind #
Bind of total distributions is total. Obtained from Unary.lossless_bind
through sampleFrom, whose mass is the mass of its distribution.
The binary product #
The independent product of two sub-distributions: a pair whose components are
drawn from d₁ and d₂.
Equations
- CatCrypt.NonUniform.prod d₁ d₂ = d₁.bind fun (a : α) => d₂.bind fun (b : β) => CatCrypt.Prob.SDistr.pure (a, b)
Instances For
The product is the two binds its definition is.
A product of total distributions is total.
The first marginal of a product is the first factor, when the second factor is total.
The second marginal of a product is the second factor, when the first factor is total.
The finite indexed product #
The independent product of a Fin n-indexed family: one draw per index,
returned as a function.
Equations
- CatCrypt.NonUniform.piFin x_2 = CatCrypt.Prob.SDistr.pure fun (i : Fin 0) => i.elim0
- CatCrypt.NonUniform.piFin ds = (ds 0).bind fun (a : α) => (CatCrypt.NonUniform.piFin fun (i : Fin n) => ds i.succ).bind fun (f : Fin n → α) => CatCrypt.Prob.SDistr.pure (Fin.cons a f)
Instances For
n independent draws from one sub-distribution.
Equations
- CatCrypt.NonUniform.replicateFin n d = CatCrypt.NonUniform.piFin fun (x : Fin n) => d
Instances For
Repeated independent draws from a total distribution are total.