Map run with Logging inputs eq run append Input Log
QueryImpl.map_run_withLogging_inputs_eq_run_appendInputLog
Project documentation
A WriterT query log can be replayed as a StateT input log. For computations over a sum spec + loggedSpec, this theorem compares two implementations: * left queries in spec are forwarded unchanged; * right queries in loggedSpec are either handled with withLogging, producing a QueryLog loggedSpec, or with appendInputLog, appending just the q...
Exact Lean statement
theorem map_run_withLogging_inputs_eq_run_appendInputLog
[LawfulMonad m₀] [HasQuery spec₀ m₀]
{α' : Type}
(so : QueryImpl loggedSpec m₀)
(oa : OracleComp (spec₀ + loggedSpec) α')
(initialInputs : List loggedSpec.Domain) :
let baseW : QueryImpl spec₀ (WriterT (QueryLog loggedSpec) m₀)Formal artifact
Lean source
theorem map_run_withLogging_inputs_eq_run_appendInputLog [LawfulMonad m₀] [HasQuery spec₀ m₀] {α' : Type} (so : QueryImpl loggedSpec m₀) (oa : OracleComp (spec₀ + loggedSpec) α') (initialInputs : List loggedSpec.Domain) : let baseW : QueryImpl spec₀ (WriterT (QueryLog loggedSpec) m₀) := (HasQuery.toQueryImpl (spec := spec₀) (m := m₀)).liftTarget _ let implW : QueryImpl (spec₀ + loggedSpec) (WriterT (QueryLog loggedSpec) m₀) := baseW + QueryImpl.withLogging so let baseS : QueryImpl spec₀ (StateT (List loggedSpec.Domain) m₀) := (HasQuery.toQueryImpl (spec := spec₀) (m := m₀)).liftTarget _ let implAppend : QueryImpl (spec₀ + loggedSpec) (StateT (List loggedSpec.Domain) m₀) := baseS + appendInputLog so ((fun z : α' × QueryLog loggedSpec => (z.1, initialInputs ++ z.2.map (fun e => e.1))) <$> ((simulateQ implW oa).run : m₀ (α' × QueryLog loggedSpec))) = ((simulateQ implAppend oa).run initialInputs : m₀ (α' × List loggedSpec.Domain)) := by induction oa using OracleComp.inductionOn generalizing initialInputs with | pure x => simp | query_bind t oa ih => cases t with | inl t' => simp [ih] | inr t' => simp only [OracleSpec.add_apply_inr, simulateQ_bind, simulateQ_query, OracleQuery.input_query, OracleQuery.cont_query, add_apply_inr, withLogging_apply, bind_pure_comp, map_bind, monad_norm, WriterT.run_bind', WriterT.run_liftM, List.empty_eq, WriterT.run_tell, List.cons_append, List.nil_append, appendInputLog_apply, modify, StateT.run_bind, StateT.run_modifyGet, StateT.run_monadLift, monadLift_self] exact bind_congr fun u => by simpa [List.append_assoc] using ih u (initialInputs ++ [t'])- Project
- VCVio
- License
- Apache-2.0
- Commit
- 2ceb2d825ee3
- Source
- VCVio/OracleComp/QueryTracking/LoggingOracle.lean:170-202
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.