Documentation

CslibFrontier.Languages.Probabilistic.SampleEach

Sampling independent programs over a finite type #

This module provides sampleEach, which runs an independent probabilistic program for each element of a finite type, generalizing OracleComp.pi which runs over Fin m.

noncomputable def Cslib.ProbComp.sampleEach {ι β : Type} [Fintype ι] (programs : ι → ProbComp β) :
ProbComp (ι → β)

Run one program for each element of a finite type, independently.

theorem Cslib.ProbComp.eval_sampleEach {ι β : Type} [Fintype ι] [Finite β] (programs : ι → ProbComp β) :
(sampleEach programs).eval = Probability.PMF.pi fun (i : ι) => (programs i).eval

The programs run by sampleEach are independent.