All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257

Exists agrees With Fn eval With Answer Fn eq iff mem support

OracleComp.exists_agreesWithFn_evalWithAnswerFn_eq_iff_mem_support

Plain-language statement

Support characterization for lazy random-oracle simulation. A value a can appear as the output of the random-oracle simulation from cache iff some total answer function agreeing with cache evaluates the computation to a. The final cache produced by the simulation is existentially quantified away.

Exact Lean statement

theorem exists_agreesWithFn_evalWithAnswerFn_eq_iff_mem_support
    [DecidableEq ι] [spec.Inhabited] [(t : spec.Domain) → SampleableType (spec.Range t)]
    (oa : OracleComp spec α) (cache : spec.QueryCache) (a : α) :
    (∃ f : QueryImpl spec Id, cache.AgreesWithFn f ∧ evalWithAnswerFn f oa = a)
    ↔
    (∃ cache' : spec.QueryCache,
      (a, cache') ∈ support ((simulateQ randomOracle oa).run cache))

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem exists_agreesWithFn_evalWithAnswerFn_eq_iff_mem_support    [DecidableEq ι] [spec.Inhabited] [(t : spec.Domain)  SampleableType (spec.Range t)]    (oa : OracleComp spec α) (cache : spec.QueryCache) (a : α) :    ( f : QueryImpl spec Id, cache.AgreesWithFn f  evalWithAnswerFn f oa = a)        ( cache' : spec.QueryCache,      (a, cache')  support ((simulateQ randomOracle oa).run cache)) := by  classical  induction oa using OracleComp.inductionOn generalizing cache a with  | pure x =>    simp only [simulateQ_pure, StateT.run_pure, evalWithAnswerFn_pure, support_pure,      Set.mem_singleton_iff, Prod.mk.injEq]    refine fun _, _, h => cache, h.symm, rfl, fun _, ha, _ => ?_    obtain f, hf := QueryCache.exists_agreesWithFn (spec := spec) cache    exact f, hf, ha.symm  | query_bind t k ih =>    have h_eval :  f : QueryImpl spec Id, evalWithAnswerFn f (liftM (spec.query t) >>= k)        = evalWithAnswerFn f (k (f t)) := fun f => by      rw [evalWithAnswerFn_bind,        show evalWithAnswerFn f (liftM (spec.query t)) = f t from simulateQ_spec_query f t]    simp_rw [h_eval]    rw [simulateQ_bind, simulateQ_spec_query, StateT.run_bind]    rcases hcache : cache t with _ | u    · simp only [support_randomOracle_run_bind_of_uncached t hcache, Set.mem_iUnion]      refine fun f, hf, ha => ?_, fun cache', u, hcache' => ?_      · obtain cache', hcache' := (ih (f t) (cache.cacheQuery t (f t)) a).mp          f, (QueryCache.agreesWithFn_cacheQuery_iff cache t (f t) f hcache).mpr hf, rfl, ha        exact cache', f t, hcache'      · obtain f, hagree, ha := (ih u (cache.cacheQuery t u) a).mpr cache', hcache'        obtain hf, hfu := (QueryCache.agreesWithFn_cacheQuery_iff cache t u f hcache).mp hagree        exact f, hf, hfu ▸ ha    · rw [QueryImpl.withCaching_run_some _ hcache, pure_bind]      refine fun f, hf, ha => (ih u cache a).mp f, hf, hf hcache ▸ ha, fun hsupp => ?_      obtain f, hf, ha := (ih u cache a).mpr hsupp      exact f, hf, hf hcache ▸ ha
Project
VCVio
License
Apache-2.0
Commit
2ceb2d825ee3
Source
VCVio/OracleComp/QueryTracking/RandomOracle/Simulation.lean:150-184

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