All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257

Cache entry in log or initial

OracleComp.cache_entry_in_log_or_initial

Plain-language statement

Converse of log_entry_in_cache_and_mono: when running loggingOracle inside cachingOracle, every cache entry that was not in the initial cache has a corresponding log entry. Combined with log_entry_in_cache_and_mono, this shows that (starting from ) the cache entries and log entries have the same set of (input, output) pairs. Proof by stru...

Exact Lean statement

theorem cache_entry_in_log_or_initial {α : Type}
    (oa : OracleComp spec α)
    (cache₀ : QueryCache spec)
    (z : (α × QueryLog spec) × QueryCache spec)
    (hmem : z ∈ support ((simulateQ cachingOracle
        ((simulateQ loggingOracle oa).run)).run cache₀)) :
    ∀ (t₀ : spec.Domain) (v : spec.Range t₀),
      z.2 t₀ = some v → cache₀ t₀ = some v ∨
        ∃ entry ∈ z.1.2, entry.1 = t₀ ∧ HEq entry.2 v

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem cache_entry_in_log_or_initial {α : Type}    (oa : OracleComp spec α)    (cache₀ : QueryCache spec)    (z : (α × QueryLog spec) × QueryCache spec)    (hmem : z  support ((simulateQ cachingOracle        ((simulateQ loggingOracle oa).run)).run cache₀)) :     (t₀ : spec.Domain) (v : spec.Range t₀),      z.2 t₀ = some v  cache₀ t₀ = some v          entry  z.1.2, entry.1 = t₀  HEq entry.2 v := by  induction oa using OracleComp.inductionOn generalizing cache₀ z with  | pure a =>    simp only [simulateQ_pure] at hmem    change z  support (pure ((a, ([] : QueryLog spec)), cache₀)) at hmem    rw [support_pure, Set.mem_singleton_iff] at hmem    subst hmem    intro t₀ v hcache    exact Or.inl hcache  | query_bind t mx ih =>    obtain u, cache_mid, ⟨⟨x', log', cache_final,      _, hcache_mid_entry, hcache_mid_eq, hmem_cont, rfl :=      exists_cont_of_run_simulateQ_query_bind t mx cache₀ z hmem    intro t₀ v hcache_final    rcases ih u cache_mid ((x', log'), cache_final) hmem_cont t₀ v hcache_final with      h_in_mid | entry, hentry, hentry_eq, hentry_heq    · by_cases ht₀ : t₀ = t      · subst ht₀        rw [hcache_mid_entry] at h_in_mid; cases h_in_mid        exact Or.inr ⟨⟨t₀, _, List.Mem.head _, rfl, HEq.rfl      · exact Or.inl (hcache_mid_eq t₀ ht₀ ▸ h_in_mid)    · exact Or.inr entry, List.Mem.tail _ hentry, hentry_eq, hentry_heq
Project
VCVio
License
Apache-2.0
Commit
2ceb2d825ee3
Source
VCVio/OracleComp/QueryTracking/Collision.lean:214-243

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