Fair PPT security for asynchronous env-open processes #
This file lifts the synchronous Concurrent.Fairness ticket
machinery to the asynchronous runtime in AsyncRuntime.lean, and
packages a fair-PPT computational security definition
secureAgainstFair that quantifies over scheduler pairs
satisfying user-specified PPT and fairness predicates.
Main definitions #
AsyncRun process envAction— an infinite execution of the async runtime, structured as inConcurrent.ProcessOver.Runbut threading the runtime alphabetRuntimeEvent Event.Ticketed Party Δ Event State— anEnvOpenProcesspaired with a stable ticket map for its underlying process steps. LiftsConcurrent.ProcessOver.Ticketedto the env-open setting.Ticketed.enabledAt/Ticketed.firedAt— process-side ticket predicates evaluated onAsyncRun.Ticketed.WeakFairOn/StrongFairOn/WeakFair/StrongFair— process-side fairness predicates lifted fromConcurrent.Fairness.SchedulerPair Party m State Event— the joint adversary type for the async runtime: a process scheduler plus a sibling env scheduler.secureAgainstFair mkSem real ideal ε isPPT isFair— fair-PPT computational emulation: every scheduler pair that is both PPT and fair distinguishes real from ideal with advantage at mostε.asympSecureAgainstFair— security-parameter-indexed, negligible variant.
Design notes #
The pair (isPPT, isFair) is intentionally orthogonal: PPT does
not imply fair delivery (an efficient adversary may starve a
process), and fair delivery does not imply PPT execution (a fair
scheduler may take unbounded internal computation between
firings).
Three different "fairness" notions in the literature are not
collapsed here. Scheduler fairness (TLA+ WF/SF, this file) is
the only one captured by isFair arguments below. UC resource
fairness is a property of the protocol design, and cryptographic
fair exchange is a security goal for specific protocols; both
compose orthogonally with secureAgainstFair.
Process tickets are the only ticket category lifted in this file.
Env tickets reduce to Event itself, but their fairness story is
governed entirely by the env scheduler (i.e. by the isFair
predicate the user supplies). Lifting a unified ticket type
carrying both process and env tickets is a deliberate non-goal at
this stage: the two sides have different enable conditions and
different adversary-control attributions and are easier to reason
about separately.
Universe constraints #
The lifted security layer pins move types, env state, env event
alphabets, and the underlying open-process universes to 0. This
matches the universe constraints already imposed by
AsyncRuntime.lean (which threads ProbComp : Type → Type
through the runtime), and is required for (openTheory.{u, 0, 0} Party).Closed to be well-formed.
Async runs #
AsyncRun process envAction is an infinite execution of the
asynchronous runtime threading the RuntimeEvent Event alphabet.
It mirrors Concurrent.ProcessOver.Run shape-for-shape, with three
extensions that match runStepsAsync:
state nis the joint runtime state at stepn, i.e. the residual process state plus the env-action bookkeeping state.event nrecords which side fired at stepn: aprocessTickconsumes theprocTranscript, while anenvTick econsumes theenvSample.next_state nenforces the coherence law of one async step: at process ticks the proc field advances by the chosen transcript; at env ticks the env state advances to the sampled new state.
This is a freer object than the runtime's randomized executions
(it does not commit to a particular scheduler); fairness
predicates are phrased over AsyncRun rather than over the
runtime distribution, exactly as
Concurrent.ProcessOver.Ticketed.WeakFair is phrased over
ProcessOver.Run.
- state : ℕ → AsyncRuntimeState process.Proc State
The joint runtime state at each step.
- event : ℕ → RuntimeEvent Event
The runtime event chosen at each step.
The process-side transcript chosen at each step. Only constrained to be coherent when
event n = .processTick; left unconstrained in the env-tick branch.- envSample : ℕ → State
The env-state result sampled at each step. Only constrained to be coherent when
event n = .envTick e. - next_state (n : ℕ) : self.state (n + 1) = match self.event n with | RuntimeEvent.processTick => let __src := self.state n; { proc := (process.step (self.state n).proc).next (self.procTranscript n), envState := __src.envState } | RuntimeEvent.envTick e => let __src := self.state n; { proc := __src.proc, envState := self.envSample n }
One-step coherence: at process ticks the proc field advances by the chosen transcript, at env ticks the env state advances to the sampled new state.
Instances For
The initial joint runtime state of an async run.
Instances For
The first runtime event of an async run.
Instances For
Ticketed env-open processes #
Ticketed Party Δ Event State packages an EnvOpenProcess with a
stable ticket map for its underlying open process.
This lifts Concurrent.ProcessOver.Ticketed to the env-open
setting. The env channel is not assigned tickets here: env
events are scheduled by the environment and are represented in
the runtime trace by their alphabet symbol directly. Process
tickets are the obligations whose firing fairness predicates
constrain.
The bundle pins all relevant universes to 0 to match the
runtime layer in AsyncRuntime.lean.
- toEnvProcess : EnvOpenProcess m Party Δ Event State
The underlying env-open process.
- Ticket : Type
The stable obligation type.
- ticket : self.toEnvProcess.process.toProcess.Tickets self.Ticket
The stable ticket assigned to each complete process-step transcript.
Instances For
The underlying open process of a ticketed env-open process.
Instances For
The env-action channel of a ticketed env-open process.
Instances For
A process ticket is enabled at step n of an async run when
some transcript through the current process spec carries that
ticket.
Equivalent to the synchronous
Concurrent.ProcessOver.Ticketed.enabledAt evaluated at the
process state (run.state n).proc. The env state is irrelevant
because tickets only label process-step obligations.
Instances For
A process ticket fires at step n of an async run when:
- the runtime fired a
processTickat stepn, and - the chosen transcript carries that ticket.
Note the asymmetry with the synchronous firedAt: an envTick
at step n cannot fire a process ticket, even though the
recorded procTranscript n is still well-formed. This matches
the operational reading that env ticks do not advance the
process side.
Instances For
Weak fairness for a single process ticket: continuously enabled implies fired infinitely often.
Lifts Concurrent.ProcessOver.Ticketed.WeakFairOn to async runs,
with the additional processTick precondition baked into
firedAt (so the env scheduler cannot vacuously satisfy weak
fairness by firing nothing but env ticks).
Instances For
Strong fairness for a single process ticket: enabled infinitely often implies fired infinitely often.
Lifts Concurrent.ProcessOver.Ticketed.StrongFairOn to async
runs, with the same processTick precondition as WeakFairOn.
Instances For
A process ticket fired at step n is enabled at step n.
Strong fairness implies weak fairness on the same ticket.
Strong fairness implies weak fairness for the whole run.
Scheduler pairs #
SchedulerPair Party m State Event bundles the two sibling
samplers driving the async runtime: a process scheduler and an
env scheduler, each indexed by the closed open-theory process
they will run against.
This is the natural "joint adversary" type for the async runtime: fair-PPT security definitions quantify over scheduler pairs.
- proc (p : (openTheory Party m schedulerSampler).Closed) : ProcessScheduler m p.Proc State fun (st : AsyncRuntimeState p.Proc State) => (p.step st.proc).spec
The process-side sampler, indexed by closed processes.
- env (p : (openTheory Party m schedulerSampler).Closed) : EnvScheduler m p.Proc State Event
The env-side sampler, indexed by closed processes.
Instances For
Fair PPT security #
Fair-PPT computational emulation up to advantage ε.
mkSem is a scheduler-parametric Semantics constructor: given
a scheduler pair, it produces a Semantics for the open-process
theory openTheory.{u, 0, 0} Party. The canonical instantiation is
fun s => processSemanticsAsync Party close envAction
initState init s.proc s.env fuel observe
isPPT is the user's PPT class on scheduler pairs (typically
specialized to PolyQueries-style query bounds plus polynomial
runtime). isFair is the user's fairness class (typically
expressed in terms of Ticketed.WeakFair / StrongFair
evaluated on every run the scheduler pair could induce).
The two predicates are intentionally orthogonal. PPT does not imply fair delivery, and fair delivery does not imply PPT execution. Conflating them would lose the standard safety/liveness vs. complexity split familiar from TLA+ and from the PIOA literature.
Instances For
Uniform CompEmulates against every scheduler pair implies
fair-PPT security against any choice of isPPT and isFair.
Self-emulation: every scheduler pair's induced semantics distinguishes a system from itself with advantage zero.
Weakening on the advantage bound.
Weakening on the PPT class: a smaller PPT class quantifies over fewer schedulers, so security against the larger class implies security against the smaller class.
Weakening on the fairness class: a smaller fairness class quantifies over fewer schedulers, so security against the larger class implies security against the smaller class.
Asymptotic version of secureAgainstFair: a security-parameter
indexed family of mkSem constructors and (real, ideal) pairs
is fair-secure when every PPT, fair adversary has negligible
distinguishing advantage in the security parameter.
The shape mirrors AsympCompEmulates from Computational.lean:
the adversary type Adv is opaque, equipped with PPT and
fairness predicates, plus an extract function producing the
scheduler pair and the closing plug at each security parameter.
Instances For
A pointwise bound on the distinguishing advantage by a negligible function implies asymptotic fair-PPT security.
A family of secureAgainstFair bounds with negligible advantage
sequence implies asymptotic fair-PPT security.