Simulate Q State T State T compose
simulateQ_StateT_StateT_compose
Plain-language statement
Three-layer simulation collapse: if a "reduction" red : QueryImpl spec₁ (StateT σ (OracleComp spec₂)) followed by an inner cached impl : QueryImpl spec₂ (StateT τ n) agrees per-query with a single "combined" handler combined : QueryImpl spec₁ (StateT (σ × τ) n) up to the natural reassociation α × σ × τ ≃ (α × σ) × τ, then the agreement extends to...
Exact Lean statement
theorem simulateQ_StateT_StateT_compose
{σ τ : Type u'} {n : Type u' → Type v'} [Monad n] [LawfulMonad n]
(red : QueryImpl spec₁ (StateT σ (OracleComp spec₂)))
(impl : QueryImpl spec₂ (StateT τ n))
(combined : QueryImpl spec₁ (StateT (σ × τ) n))
(bridge : ∀ (q : spec₁.Domain) (s : σ) (c : τ),
(simulateQ impl ((red q).run s)).run c =
(fun r : spec₁.Range q × σ × τ => ((r.1, r.2.1), r.2.2)) <$> combined q (s, c))
{α : Type u'} (oa : OracleComp spec₁ α) (s : σ) (c : τ) :
(simulateQ impl ((simulateQ red oa).run s)).run c =
(fun r : α × σ × τ => ((r.1, r.2.1), r.2.2)) <$> (simulateQ combined oa).run (s, c)Formal artifact
Lean source
theorem simulateQ_StateT_StateT_compose {σ τ : Type u'} {n : Type u' → Type v'} [Monad n] [LawfulMonad n] (red : QueryImpl spec₁ (StateT σ (OracleComp spec₂))) (impl : QueryImpl spec₂ (StateT τ n)) (combined : QueryImpl spec₁ (StateT (σ × τ) n)) (bridge : ∀ (q : spec₁.Domain) (s : σ) (c : τ), (simulateQ impl ((red q).run s)).run c = (fun r : spec₁.Range q × σ × τ => ((r.1, r.2.1), r.2.2)) <$> combined q (s, c)) {α : Type u'} (oa : OracleComp spec₁ α) (s : σ) (c : τ) : (simulateQ impl ((simulateQ red oa).run s)).run c = (fun r : α × σ × τ => ((r.1, r.2.1), r.2.2)) <$> (simulateQ combined oa).run (s, c) := by induction oa using OracleComp.inductionOn generalizing s c with | pure x => simp [StateT.run_pure] | query_bind t f ih => simp only [simulateQ_bind, StateT.run_bind, simulateQ_spec_query] rw [bridge t s c, bind_map_left, map_bind] exact bind_congr fun r => ih r.1 r.2.1 r.2.2- Project
- VCVio
- License
- Apache-2.0
- Commit
- 2ceb2d825ee3
- Source
- VCVio/OracleComp/SimSemantics/SimulateQ.lean:319-335
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
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.
Source project: VCVio
Person-level attribution pending.
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.
Source project: VCVio
Person-level attribution pending.
IND CPA LR hybrid Game q eval Dist eq left of Makes At Most Queries
AsymmEncAlg.IND_CPA_LR_hybridGame_q_evalDist_eq_left_of_MakesAtMostQueries
Plain-language statement
If an adversary makes at most q fresh LR queries, then the leftUntil = q LR-hybrid is the all-left endpoint game.
Source project: VCVio
Person-level attribution pending.