All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257

Unforgeable Adv advantage le unforgeable Exp No Fresh

SignatureAlg.unforgeableAdv.advantage_le_unforgeableExpNoFresh

Plain-language statement

Phase B (freshness-drop) bound. The CMA advantage is bounded above by the success probability of the same experiment with the freshness check dropped. Both unforgeableExp and unforgeableExpNoFresh factor as runtime.evalDist (joint >>= ...) sharing the same prefix joint. The hypothesis h_pull packages the runtime-specific factoring step that...

Exact Lean statement

lemma unforgeableAdv.advantage_le_unforgeableExpNoFresh
    {sigAlg : SignatureAlg (OracleComp spec) M PK SK S}
    (runtime : ProbCompRuntime (OracleComp spec))
    (h_pull : ∀ {α β : Type} (f : α → β) (mx : OracleComp spec α),
      runtime.evalDist (mx >>= fun x => pure (f x)) = f <$> runtime.evalDist mx)
    (adv : unforgeableAdv sigAlg) :
    adv.advantage runtime ≤ Pr[= true | unforgeableExpNoFresh runtime adv]

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
lemma unforgeableAdv.advantage_le_unforgeableExpNoFresh    {sigAlg : SignatureAlg (OracleComp spec) M PK SK S}    (runtime : ProbCompRuntime (OracleComp spec))    (h_pull :  {α β : Type} (f : α  β) (mx : OracleComp spec α),      runtime.evalDist (mx >>= fun x => pure (f x)) = f <$> runtime.evalDist mx)    (adv : unforgeableAdv sigAlg) :    adv.advantage runtime  Pr[= true | unforgeableExpNoFresh runtime adv] := by  letI : DecidableEq M := Classical.decEq M  letI : DecidableEq S := Classical.decEq S  unfold unforgeableAdv.advantage unforgeableExp unforgeableExpNoFresh  set joint : OracleComp spec (M × QueryLog (M ₒ S) × Bool) := do    let (pk, sk)  sigAlg.keygen    let impl : QueryImpl (spec + (M ₒ S))        (WriterT (QueryLog (M ₒ S)) (OracleComp spec)) :=      (HasQuery.toQueryImpl (spec := spec) (m := OracleComp spec)).liftTarget        (WriterT (QueryLog (M ₒ S)) (OracleComp spec)) +        sigAlg.signingOracle pk sk    let sim_adv : WriterT (QueryLog (M ₒ S)) (OracleComp spec) (M × S) :=      simulateQ impl (adv.main pk)    let ((msg, σ), log)  sim_adv.run    let verified  sigAlg.verify pk msg σ    pure (msg, log, verified) with hjoint_def  have hExp : (runtime.evalDist do        let (pk, sk)  sigAlg.keygen        let impl : QueryImpl (spec + (M ₒ S))            (WriterT (QueryLog (M ₒ S)) (OracleComp spec)) :=          (HasQuery.toQueryImpl (spec := spec) (m := OracleComp spec)).liftTarget            (WriterT (QueryLog (M ₒ S)) (OracleComp spec)) +            sigAlg.signingOracle pk sk        let sim_adv : WriterT (QueryLog (M ₒ S)) (OracleComp spec) (M × S) :=          simulateQ impl (adv.main pk)        let ((msg, σ), log)  sim_adv.run        let verified  sigAlg.verify pk msg σ        pure (!log.wasQueried msg && verified)) =      (fun t : M × QueryLog (M ₒ S) × Bool => !t.2.1.wasQueried t.1 && t.2.2) <$>        runtime.evalDist joint := by    rw [ h_pull]    congr 1    simp only [hjoint_def, monad_norm]  have hNoFresh : (runtime.evalDist do        let (pk, sk)  sigAlg.keygen        let impl : QueryImpl (spec + (M ₒ S))            (WriterT (QueryLog (M ₒ S)) (OracleComp spec)) :=          (HasQuery.toQueryImpl (spec := spec) (m := OracleComp spec)).liftTarget            (WriterT (QueryLog (M ₒ S)) (OracleComp spec)) +            sigAlg.signingOracle pk sk        let sim_adv : WriterT (QueryLog (M ₒ S)) (OracleComp spec) (M × S) :=          simulateQ impl (adv.main pk)        let ((msg, σ), _)  sim_adv.run        sigAlg.verify pk msg σ) =      (fun t : M × QueryLog (M ₒ S) × Bool => t.2.2) <$> runtime.evalDist joint := by    rw [ h_pull]    congr 1    simp only [hjoint_def, monad_norm]  rw [hExp, hNoFresh,  probEvent_eq_eq_probOutput,  probEvent_eq_eq_probOutput,    probEvent_map, probEvent_map]  exact probEvent_mono fun _ _ => Bool.and_elim_right
Project
VCVio
License
Apache-2.0
Commit
2ceb2d825ee3
Source
VCVio/CryptoFoundations/SignatureAlg.lean:221-277

Reuse this declaration

Bring the exact result into your workflow

The import identifies the source module. Your project still needs the pinned package dependency shown on this page.

What this badge means

This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.

Continue in this project

Related declarations

Project-declaredLean 4.32.0

Expected Cost Nat eq sum tail probs of pathwise Cost At Most

AddWriterT.expectedCostNat_eq_sum_tail_probs_of_pathwiseCostAtMost

Plain-language statement

Finite tail-sum formula for natural-valued writer cost under a pathwise upper bound. If every execution path of oa incurs cost at most n, then the tail probabilities vanish above n, so the infinite tail sum truncates to Finset.range n.

program verificationseparation logiccryptography

Source project: VCVio

Person-level attribution pending.

View proof record
Project-declaredLean 4.32.0

IND CPA advantage to Real le sum step signed Advantage Real abs

AsymmEncAlg.IND_CPA_advantage_toReal_le_sum_step_signedAdvantageReal_abs

Plain-language statement

Planned generic one-time-to-many-time lift: bounded multi-query IND-CPA advantage is at most the sum of the extracted one-time signed advantages over the first q fresh LR queries.

program verificationseparation logiccryptography

Source project: VCVio

Person-level attribution pending.

View proof record