Enhanced Failure Event Lemma Variants #
This file provides enhanced variants of the Failure Event Lemma (FEL)
from Bridge.lean, tailored to common use patterns in cryptographic
security proofs.
Main results #
Direct advantage bounds #
advantage_le_prBad-Advantage G₀ G₁ ≤ Pr[G₀:bad](FEL for Advantage, G₀ lossless)advantage_le_prBad_right- FEL from the right:Advantage G₀ G₁ ≤ Pr[G₁:bad](G₁ lossless)advantageA_le_prBad- FEL forAdvantageAwith explicit adversary
Game hopping chains #
advantage_le_two_bad- Two-step game hopping via FELadvantage_le_three_bad- Three-step game hopping via FEL
Event-based FEL #
prEvent_diff_le_prBad-|Pr[G₀:E] - Pr[G₁:E]| ≤ Pr[G₀:bad]for any eventprEvent_agree_of_no_bad- Events agree exactly when bad never happens
Composition lemmas #
agree_trans- Transitivity of up-to-bad agreementagree_bind_right- Shared prefix preserves agreement
References #
- EasyCrypt:
feltactic, up-to-bad reasoning - Barthe et al., "CertiCrypt" (failure event lemma)
- Bellare & Rogaway, "The Security of Triple Encryption and a Framework for Code-Based Game-Playing Proofs" (game hopping)
Direct Advantage Bounds #
The Failure Event Lemma stated directly as an Advantage bound.
Advantage G₀ G₁ ≤ Pr[G₀ : bad]
when G₀ and G₁ agree on all non-bad outcomes and G₀ is lossless.
This wraps failure_event_lemma with the standard Heap.empty initial heap.
FEL from the right side: Advantage G₀ G₁ ≤ Pr[G₁ : bad].
Symmetric to advantage_le_prBad, but bounds by the bad probability
under G₁ (using G₁'s losslessness). Follows from failure_event_lemma
applied to (G₁, G₀) and using commutativity of Advantage.
FEL for AdvantageA with an explicit adversary.
When the composed games G₀.bind A and G₁.bind A agree on non-bad
outcomes, the advantage through A is bounded by the bad-event probability.
FEL with union of bad events: bound by Pr[G₀ : bad₀ ∨ bad₁].
When games agree on outcomes where neither bad₀ nor bad₁ holds,
bound the advantage by the probability of either bad event.
The union bound then gives Pr[bad₀ ∨ bad₁] ≤ Pr[bad₀] + Pr[bad₁]
(use prEvent_union_le from Event.lean for that step).
Game Hopping Chains #
Two-step game hopping via FEL.
Advantage G₀ G₂ ≤ Pr[G₀:bad₀₁] + Pr[G₁:bad₁₂]
when G₀ ≈ G₁ (up to bad₀₁) and G₁ ≈ G₂ (up to bad₁₂).
Three-step game hopping via FEL.
Advantage G₀ G₃ ≤ Pr[G₀:bad₀₁] + Pr[G₁:bad₁₂] + Pr[G₂:bad₂₃]
A common pattern in cryptographic proofs (e.g., PRF/PRP switching).
Event-Based FEL #
FEL for arbitrary events: |Pr[G₀:E] - Pr[G₁:E]| ≤ Pr[G₀:bad].
This generalizes the standard FEL from prTrue (event b=true) to
any event E on the output value and heap. When G₀ and G₁ agree
on non-bad outcomes, the probabilities of any event E also agree
up to the bad probability.
Composition Lemmas #
Transitivity of up-to-bad reasoning: if G₀ ≈ G₁ up to bad₁ and G₁ ≈ G₂ up to bad₂, then G₀ ≈ G₂ when neither bad holds.
If games agree on non-bad outcomes, adding the same prefix preserves agreement.
When c is a shared prefix computation and G₀, G₁ are continuations that
agree on non-bad outcomes, then c.bind G₀ and c.bind G₁ also agree
on non-bad outcomes.
Different prefixes with the same continuation: if two prefixes agree on non-bad intermediate states and bad is backward-monotone through the continuation, then the composed computations agree on non-bad outcomes.
Backward monotonicity means: if the output of k a h₁ can reach a non-bad
final state h₂, then the intermediate state h₁ was also non-bad.
This is the dual of agree_bind_right, where the CONTINUATION differs and
the prefix is shared. Together, these compose into agree_bind_both.
General composition: both prefix and continuation may differ.
If two prefixes agree on non-bad intermediate states, two continuations agree on non-bad final states, and bad is backward-monotone through the first continuation, then the composed computations agree on non-bad outcomes.
This combines the patterns of agree_bind_left and agree_bind_right.
It is the key building block for up-to-bad reasoning with oracle composition.
FEL variant: if games agree on non-bad outcomes and both sides are lossless, then bad mass is the same in both games.
This is a helper for proofs that need to move between
Pr[G₀:bad] and Pr[G₁:bad].
When both games are lossless and agree on non-bad outcomes, their bad-event probabilities are equal.
Combines prBad_le_of_agree in both directions.