Lazy initialization equivalence for parallel SSP packages #
This module defines Cslib.Crypto.Protocols.SSP.parFinLazy, the lazy first-touch parallel package
combinator over an arbitrary [DecidableEq SID] (specializing definitionally to
SSP.sessionSpec m E at SID := Fin m), and proves:
Cslib.Crypto.Protocols.SSP.run_parFinLazy_eq_parFin: overFin m, running lazyparFinLazy Mon any adaptive client program has the same output distribution as running eagerSSP.parFin M.Cslib.Crypto.Protocols.SSP.touchedSessions_transcript_card_le,Cslib.Crypto.Protocols.SSP.mem_support_parFinLazy_touched_card_le, andCslib.Crypto.Protocols.SSP.mem_support_parFinLazy_init_touched_card_le: anyb-query-bounded client touches or initializes at mostbdistinct sessions inSID.Cslib.Crypto.Protocols.SSP.eval_run_parFinLazy_eq_parFin_alloc: for a homogeneous familyfun _ : SID => M₀and anyb-query-bounded program overdynSessionSpec SID E, first-touch slot allocation (allocMachine) reducesparFinLazyto eagerSSP.parFinoverFin (b + 1)while preserving the exact query boundb(isQueryBounded_link_allocMachine).
Because CslibFrontier.Crypto.Protocols.SSP.Basic supplies UC.Machine via
CslibFrontier.Crypto.Protocols.UC.Linking, SSP callers can import this bridge without importing
the UC ideal-functionality, execution, or joint-state modules.
Proof strategy #
RandomOracle.pi_bind_eq_map_fst_of_complete_eq equates eager upfront sampling with lazy caching
over a finite-domain family of PMFs. Because each (M j).init : ProbComp (M j).State has
arbitrary state type (M j).State rather than a Finite instance, we restrict each initializer to
its finite support subtype EvalSupport (M j).init and convert OracleComp.pi via
Probability.PMF.pi_fin_succ_dep, separating the once-sampled initial-state cache from the mutable
per-session execution state. For arbitrary [DecidableEq SID], allocMachine assigns each newly
queried sid : SID sequentially to slots 0, ..., b - 1 of Fin (b + 1), reducing homogeneous
parFinLazy to Fin (b + 1) before invoking run_parFinLazy_eq_parFin.
Main definitions #
Cslib.Crypto.Protocols.SSP.dynSessionSpec: dynamically indexed session interface overSID.Cslib.Crypto.Protocols.SSP.parFinLazy: lazy first-touch parallel package runner over any[DecidableEq SID].Cslib.Crypto.Protocols.SSP.touchedSessions:Finset SIDof session identifiers queried along a transcript (characterized byCslib.Crypto.Protocols.SSP.mem_touchedSessions).Cslib.Crypto.Protocols.SSP.allocMachine: first-touch slot allocator reindexing dynamicSIDqueries intoSSP.sessionSpec (m + 1) E.
Main results #
Cslib.Crypto.Protocols.SSP.isBounded_parFinLazy: call-budget bound2 * tforparFinLazy M, independent of session count.Cslib.Crypto.Protocols.SSP.touchedSessions_transcript_card_le,Cslib.Crypto.Protocols.SSP.mem_support_parFinLazy_touched_card_le,Cslib.Crypto.Protocols.SSP.mem_support_parFinLazy_init_touched_card_le: at mostbdistinct sessions are queried or initialized along anyb-bounded execution.Cslib.Crypto.Protocols.SSP.run_parFinLazy_eq_parFin: lazy first-touch initialization agrees in distribution with eagerSSP.parFininitialization overFin m.Cslib.Crypto.Protocols.SSP.isQueryBounded_link_allocMachine: linking throughallocMachinepreserves the query boundb.Cslib.Crypto.Protocols.SSP.eval_run_parFinLazy_eq_parFin_alloc: finite first-touch reindexing and lazy-vs-eager equivalence betweenparFinLazyover[DecidableEq SID]and eagerSSP.parFinoverFin (b + 1).
Interface of dynamically indexed sessions over SID: a query pairs a session identifier
sid : SID with an E-query q, answered as E q. Specializes definitionally to
SSP.sessionSpec m E when SID := Fin m.
Lazy first-touch parallel composition of a family of closed machines
M : SID → Machine OracleSpec.empty E over an arbitrary [DecidableEq SID]: each session sid
starts uninitialized (none) and samples (M sid).init on its first query. At SID := Fin m
this is the lazy variant of SSP.parFin.
Every activation of parFinLazy M makes at most 2 * t calls when each M sid is
t-bounded (at most t for first-touch initialization plus t for the activation itself).
The Finset SID of session identifiers queried along a transcript over
probOracleSpec (dynSessionSpec SID E).
A session identifier sid belongs to touchedSessions t if and only if some external query
to sid appears in the transcript t.
Along any supported run of a b-query-bounded program against a stateful oracle over
probOracleSpec (dynSessionSpec SID E), the Finset SID of touched session IDs has cardinality at
most b.
Along any supported run of parFinLazy M on a program making at most b external calls
(counting private coin samples at cost 0), at most b new sessions become initialized
(some).
Starting from the initial all-none state of parFinLazy M, any supported run of a
b-query-bounded program leaves at most b distinct sessions initialized.
Lazy first-touch initialization agrees in distribution with eager SSP.parFin initialization
for any adaptive client program, via RandomOracle.pi_bind_eq_map_fst_of_complete_eq.
Finite first-touch allocator and lazy-vs-eager equivalence #
First-touch allocator translating dynamic queries over dynSessionSpec SID E into fixed-arity
queries over SSP.sessionSpec (m + 1) E. Up to m distinct session identifiers receive sequential
indices 0, ..., m - 1, and Fin.last m serves as an unreachable fallback slot.
Linking a b-query-bounded program through allocMachine preserves the exact query bound b,
because allocMachine makes no initialization calls and forwards each external query with one
external call.
Lazy-vs-eager finite reindexing equivalence: running parFinLazy (fun _ => M₀) on any
b-query-bounded dynamic-SID program gives the exact same output distribution as running eager
SSP.parFin (fun (_ : Fin (b + 1)) => M₀) on the first-touch reindexed program
(allocMachine SID b E).link prog.