All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257

Run m Of Fn query hit

Fischlin.run_mOfFn_query_hit

Plain-language statement

Simulating the verifier's Fin.mOfFn of random-oracle re-queries on a cache that already stores every re-queried record is deterministic: each query is a cache hit returning the stored value, leaving the cache untouched. The result is the pure product of the per-repetition outputs f i (hash i), where hash i is the value cached at record i.

Exact Lean statement

lemma run_mOfFn_query_hit {β : Type} (n : ℕ)
    (records : Fin n → (fischlinROSpec Stmt Commit Chal Resp ρ b M).Domain)
    (hash : Fin n → Fin (2 ^ b)) (f : Fin n → Fin (2 ^ b) → β)
    (cache : (fischlinROSpec Stmt Commit Chal Resp ρ b M).QueryCache)
    (hhit : ∀ i, cache (records i) = some (hash i)) :
    (simulateQ (fischlinImpl ρ b M)
        (Fin.mOfFn n fun i => do
          let h ← HasQuery.query (spec := fischlinROSpec Stmt Commit Chal Resp ρ b M) (records i)
          pure (f i h))).run cache
      = pure ((fun i => f i (hash i)), cache)

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
lemma run_mOfFn_query_hit {β : Type} (n : )    (records : Fin n  (fischlinROSpec Stmt Commit Chal Resp ρ b M).Domain)    (hash : Fin n  Fin (2 ^ b)) (f : Fin n  Fin (2 ^ b)  β)    (cache : (fischlinROSpec Stmt Commit Chal Resp ρ b M).QueryCache)    (hhit :  i, cache (records i) = some (hash i)) :    (simulateQ (fischlinImpl ρ b M)        (Fin.mOfFn n fun i => do          let h  HasQuery.query (spec := fischlinROSpec Stmt Commit Chal Resp ρ b M) (records i)          pure (f i h))).run cache      = pure ((fun i => f i (hash i)), cache) := by  induction n with  | zero =>      simp only [Fin.mOfFn, simulateQ_pure, StateT.run_pure]      congr 1      congr 1      exact Subsingleton.elim _ _  | succ n ih =>      rw [Fin.mOfFn, simulateQ_bind, StateT.run_bind, simulateQ_bind,        roSim.simulateQ_HasQuery_query, StateT.run_bind,        QueryImpl.withCaching_run_some (so := uniformSampleImpl) (hhit 0),        pure_bind, simulateQ_pure, StateT.run_pure, pure_bind,        simulateQ_bind, StateT.run_bind,        ih (fun j => records j.succ) (fun j => hash j.succ) (fun j => f j.succ)          (fun j => hhit j.succ), pure_bind, simulateQ_pure, StateT.run_pure]      congr 1      refine Prod.ext ?_ rfl      funext j      refine Fin.cases ?_ (fun k => ?_) j      · simp [Fin.cons_zero]      · simp [Fin.cons_succ]
Project
VCVio
License
Apache-2.0
Commit
2ceb2d825ee3
Source
VCVio/CryptoFoundations/Fischlin/Completeness.lean:585-614

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