All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257

Nma to hard relation bound

FiatShamir.nma_to_hard_relation_bound

Project documentation

NMA-to-extraction via the forking lemma and special soundness. The parameter qH is the fork slot parameter passed to Fork.forkPoint qH, i.e., the number of Fin (qH + 1) candidate target positions over which the replay-forking lemma sums. It is not required to be a valid query bound on the adversary: callers may supply a wrapped adversary with up...

Exact Lean statement

theorem nma_to_hard_relation_bound
    [DecidableEq M] [DecidableEq Commit]
    [SampleableType Wit] [SampleableType Chal]
    (hss : σ.SpeciallySound)
    (hss_nf : ∀ ω₁ p₁ ω₂ p₂, Pr[⊥ | σ.extract ω₁ p₁ ω₂ p₂] = 0)
    [Fintype Chal] [Inhabited Chal]
    (nmaAdv : SignatureAlg.managedRoNmaAdv
      (FiatShamir (m := OracleComp (unifSpec + (M × Commit →ₒ Chal))) σ hr M))
    (qH : ℕ) :
    ∃ reduction : Stmt → ProbComp Wit,
      (Fork.advantage σ hr M nmaAdv qH *
          (Fork.advantage σ hr M nmaAdv qH / (qH + 1 : ENNReal) -
            challengeSpaceInv Chal)) ≤
        Pr[= true | hardRelationExp hr reduction]

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem nma_to_hard_relation_bound    [DecidableEq M] [DecidableEq Commit]    [SampleableType Wit] [SampleableType Chal]    (hss : σ.SpeciallySound)    (hss_nf :  ω₁ p₁ ω₂ p₂, Pr[⊥ | σ.extract ω₁ p₁ ω₂ p₂] = 0)    [Fintype Chal] [Inhabited Chal]    (nmaAdv : SignatureAlg.managedRoNmaAdv      (FiatShamir (m := OracleComp (unifSpec + (M × Commit Chal))) σ hr M))    (qH : ) :     reduction : Stmt  ProbComp Wit,      (Fork.advantage σ hr M nmaAdv qH *          (Fork.advantage σ hr M nmaAdv qH / (qH + 1 : ENNReal) -            challengeSpaceInv Chal))         Pr[= true | hardRelationExp hr reduction] := by  classical  refine nmaReduction σ hr M nmaAdv qH, ?_  set acc : Stmt  ENNReal := fun pk =>    Pr[ fun x => (Fork.forkPoint (M := M) (Commit := Commit) (Resp := Resp)      (Chal := Chal) qH x).isSome | Fork.runTrace σ hr M nmaAdv pk] with hacc_def  have hAdv_eq_tsum :      Fork.advantage σ hr M nmaAdv qH =        ∑' pkw : Stmt × Wit, Pr[= pkw | hr.gen] * acc pkw.1 := by    simp only [Fork.advantage, Fork.exp,  probEvent_eq_eq_probOutput,      probEvent_simulateQ_unifChalImpl, probEvent_bind_eq_tsum, bind_pure_comp,      probEvent_map, Function.comp_def, probEvent_liftComp, acc]  have hRHS_eq_tsum :      Pr[= true | hardRelationExp hr (nmaReduction σ hr M nmaAdv qH)] =        ∑' pkw : Stmt × Wit, Pr[= pkw | hr.gen] *          Pr[ fun w : Wit => rel pkw.1 w = true |            nmaReduction σ hr M nmaAdv qH pkw.1] := by    simp only [hardRelationExp,  probEvent_eq_eq_probOutput, bind_pure_comp,      probEvent_bind_eq_tsum, probEvent_map, Function.comp_def]  -- The replay-forking bound feeds the per-`pk` witness-extraction bound.  have hPerPkFinal :  pk : Stmt,      acc pk * (acc pk / (qH + 1 : ENNReal) - challengeSpaceInv Chal)         Pr[ fun w : Wit => rel pk w = true |          nmaReduction σ hr M nmaAdv qH pk] := fun pk =>    (Fork.replayForkingBound:= σ) (hr := hr) (M := M) nmaAdv qH pk        (P_out := forkSupportInvariant σ M qH pk)        (hP := fun h => forkSupportInvariant_of_mem_replayFirstRun σ hr M nmaAdv qH pk h)        (hreach := Fork.runTrace_forkPoint_CfReachable:= σ) (hr := hr) (M := M) nmaAdv qH pk)).trans      (perPk_extraction_bound σ hr M nmaAdv qH hss hss_nf pk)  rw [hAdv_eq_tsum, hRHS_eq_tsum]  exact OracleComp.EvalDist.marginalized_jensen_forking_bound (mx := hr.gen)    (acc := fun pkw => acc pkw.1)    (B := fun pkw => Pr[ fun w : Wit => rel pkw.1 w = true |      nmaReduction σ hr M nmaAdv qH pkw.1])    (q := (qH : ENNReal) + 1) (hinv := challengeSpaceInv Chal)    challengeSpaceInv_ne_top (fun _ => probEvent_le_one) (fun pkw => hPerPkFinal pkw.1)
Project
VCVio
License
Apache-2.0
Commit
2ceb2d825ee3
Source
VCVio/CryptoFoundations/FiatShamir/Sigma/Reductions.lean:310-359

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