Collecting runs in finite tuples and vectors #
OracleComp.pi collects successive runs of a dependent family of oracle computations indexed by
Fin m, in index order, and OracleComp.piRestrict runs only the coordinates belonging to a
subset I : Finset (Fin m). OracleComp.replicateFin is the homogeneous specialization of
OracleComp.pi to a single repeated program. Listing its coordinates gives the existing
list-valued repetition program OracleComp.replicate; closed ProbComp runs draw independent
values with the product distribution PMF.pi.
Main definitions #
Cslib.OracleComp.pi: collect successive runs of a dependent family overFin m.Cslib.OracleComp.piRestrict: run only the coordinates in a subsetI : Finset (Fin m).Cslib.OracleComp.replicateFin: collect successive runs of one program in a length-indexed vector (pi (fun _ => program)).
Main results #
Cslib.OracleComp.replicateFin_eq_pi:replicateFinis the constant-family specialization ofpi.Cslib.OracleComp.map_ofFn_replicateFin: agreement with list-valued repetition.Cslib.ProbComp.mem_support_pi_iff,Cslib.ProbComp.mem_support_replicateFin_iff: support is coordinatewise, even for infinite types.Cslib.ProbComp.eval_pi,Cslib.ProbComp.eval_replicateFin: independent finite coordinates have the product lawPMF.pi.Cslib.ProbComp.eval_pi_map,Cslib.ProbComp.eval_replicateFin_map_coords: coordinatewise maps commute withpiandreplicateFin.Cslib.ProbComp.eval_bind_restrict_pi,Cslib.ProbComp.eval_map_restrict_pi: restrictingeval (pi programs)toI : Finset (Fin m)runs only the programs inI.Cslib.ProbComp.eval_replicateFin_map: list-valued encodings preserve the joint law.Cslib.ProbComp.eval_replicateFin_of_uniformList: a flat fair-bit seed supplies every run.
References #
This is the finite-tuple interface to OracleComp.replicate and its product-distribution laws.
Collect successive runs of a dependent family of oracle computations over Fin m, in
execution order (0, 1, …, m - 1).
Instances For
Run the programs in a subset I : Finset (Fin m) in index order, returning a dependent tuple
on I without running programs outside I.
Instances For
Collect successive runs as a length-indexed vector, in execution order.
Instances For
replicateFin is the constant-family specialization of pi.
Listing the coordinates gives exactly the existing repeated-run program.
Mapping each coordinate program commutes with pi.
Coordinatewise monadic bind distributes over eval (OracleComp.pi ...).
Pairing independent coordinate programs in OracleComp.pi is equivalent to binding two
independent OracleComp.pi runs.
Swapping Fin m and Fin k in a nested OracleComp.pi preserves the evaluated PMF.
Binding eval (pi programs) to a continuation that depends only on I.restrict r is
equivalent to running only the programs in I via piRestrict. No finiteness assumption on α
is needed.
Restricting eval (pi programs) to a subset I : Finset (Fin m) has the same law as
piRestrict I (I.restrict programs).
The vector support consists exactly of the tuples of individually supported values.
Finite coordinate distributions give the independent product law.
Repeating a representation of each sampled value gives the represented vector law.
Mapping each coordinate after independent runs agrees with mapping each run's outcome. Neither outcome type needs to be finite.
Disjoint blocks of one uniform tape realize a vector of independently sampled values. The output type may be infinite, and either the count or the block width may be zero.