Eager Random Oracle #
The eager random oracle serves answers from a pre-generated QuerySeed, consuming values
sequentially and falling back to fresh uniform sampling when exhausted. Different calls to
the same oracle consume different seed values. State: QuerySeed.
This gives INDEPENDENT samples (each call consumes a different seed value), unlike
randomOracle which gives CONSISTENT samples (same input → same output via caching).
When averaged over a uniformly sampled seed, the eager version matches the fresh
independent-query semantics of evalDist.
The eager random oracle: serves answers from a pre-generated QuerySeed, consuming
seed values sequentially and falling back to fresh uniform sampling when exhausted.
Concretely, on query t:
- If
seed tis non-empty, return the head and advance to the tail. - If
seed tis empty, sample$ᵗ spec.Range tuniformly and leave the seed unchanged.
Important: This gives INDEPENDENT samples (each call consumes a different seed value),
unlike randomOracle which gives CONSISTENT samples (same input → same output via caching).
The two models agree when no oracle index is queried more than once.
This is definitionally equal to uniformSampleImpl.withPregen (from SeededOracle.lean).
Instances For
With an empty seed, the eager random oracle reduces to uniformSampleImpl:
every query falls through to fresh uniform sampling with no state change.
This is a faithful simulation (preserves evalDist).
The eager random oracle, averaged over a uniformly sampled seed, matches the
fresh independent-query semantics of evalDist. This is because the pre-sampled
seed values are i.i.d. uniform, exactly matching fresh oracle queries.
This is the analog of seededOracle.evalDist_liftComp_generateSeed_bind_simulateQ_run'
but for eagerRandomOracle (which falls back to ProbComp rather than OracleComp spec).