ROM Collision Infrastructure #
Collision predicates on QueryLog and QueryCache, together with structural
lemmas relating log entries and cache entries when running loggingOracle
inside cachingOracle.
Main declarations #
OracleComp.LogHasCollision: two log entries at distinct positions with distinct inputs butHEq-equal outputs.OracleComp.CacheHasCollision: two distinct cache inputs map to the same output.OracleComp.cache_lookup_eq_of_noCollision: in a collision-free cache, a value determines at most one query input.OracleComp.log_entry_in_cache_and_mono: every log entry ends up in the cache, and the cache is monotone.OracleComp.cache_entry_in_log_or_initial: every new cache entry has a corresponding log entry.
Collision Predicates #
A query log has a collision: two entries at distinct positions with distinct inputs but HEq-equal outputs.
Instances For
A cache has a collision: two distinct inputs map to the same output.
Instances For
In a collision-free cache, a value determines at most one query input.
Log entries are cached after logging inside caching #
When running loggingOracle inside cachingOracle, every log entry ends up in the cache.
We prove two properties simultaneously by induction:
- Every log entry is in the final cache.
- The initial cache is a subset of the final cache (monotonicity).
The proof works by induction on oa. The pure case is trivial (empty log).
For query t >>= mx: the logging oracle decomposes as
query t >>= fun u => map (prepend ⟨t,u⟩) ...,
and cachingOracle caches the query result u at t. By the IH applied to mx u,
all sub-log entries are in the final cache, and cache monotonicity ensures t ↦ u persists.
Converse of log_entry_in_cache_and_mono: when running loggingOracle inside
cachingOracle, every cache entry that was not in the initial cache has a corresponding
log entry. Combined with log_entry_in_cache_and_mono, this shows that (starting from ∅)
the cache entries and log entries have the same set of (input, output) pairs.
Proof by structural induction on oa, mirroring log_entry_in_cache_and_mono.