Documentation

CslibFrontier.Probability.IID.FirstSome

The first successful IID trial #

Map Fin.findSome? over a finite tuple of independent Option-valued trials. Failure means that every trial returned none, so its mass is the one-trial failure mass raised to the tuple length.

Main definitions #

This module adds no definitions; it composes PMF.iid with Fin.findSome?.

Main results #

References #

The identity is the elementary product rule for independent failures.

The first-success map over K IID Option-valued trials fails with mass μ none ^ K.

theorem Cslib.Probability.PMF.iid_map_findSome {α β ι : Type} (p : PMF α) (finish : α → Option β) (xs : List ι) :
PMF.map (fun (v : Fin xs.length → α) => Fin.findSome? fun (i : Fin xs.length) => finish (v i)) (iid p xs.length) = List.findSomeM? (fun (x : ι) => PMF.map finish p) xs

Searching an IID tape gives the same first terminal answer as drawing on demand and stopping.