Adaptive planted-query union bounds for ProbOracleComp #
In a multi-query reduction (such as chosen-ciphertext decryption-rejection hops or adaptive
search-to-decision reductions), an adversary interacts with an oracle that latches a bad event on
the first target query satisfying isBad q s, while a reduction guesses the zero-based target-query
index j < Q uniformly, simulates the < j target queries faithfully with sim, captures
extract q on target query j, and answers query j and all subsequent queries with dummyReply
without further state changes.
plantedHandler packages that countdown-and-capture state machine over the named composite record
PlantedOracleState Cand State, using StateLens.zoom on passive (isTarget q = false) calls.
toOuterMeasure_bad_le_sum_planted_of_cost proves the adaptive union bound once by induction on
the structural target-query budget IsCostBounded: the probability of reaching bad from
embed s is at most the sum over j ∈ Finset.range Q of the probability that the j-th planted
execution captures a winning candidate (hasCaptured ∧ win candidate oracleState).
toOuterMeasure_bad_le_sum_planted specializes isTarget to fun _ => true for total external
query budgets ProbOracleComp.IsQueryBounded program Q.
Main definitions #
Cslib.ProbOracleComp.PlantedState: countdownrem, capture flaghasCaptured, and capturedcandidate.Cslib.ProbOracleComp.PlantedOracleState: composite state pairingPlantedState Candwith the underlying oracle stateState, equipped withplantedLensandoracleStateLens.Cslib.ProbOracleComp.plantedHandler: stateful planted-index countdown handler.
Main results #
Cslib.ProbOracleComp.runWith_plantedHandler_captured_bind_eq_one: oncehasCaptured = true,plantedHandlerfreezesPlantedOracleStateacross any adaptive continuation.Cslib.ProbOracleComp.toOuterMeasure_bad_le_sum_planted_of_cost,Cslib.ProbOracleComp.toOuterMeasure_bad_le_sum_planted_candidate_of_cost: cost-filtered adaptive planted-query union bounds overj ∈ Finset.range Q.Cslib.ProbOracleComp.toOuterMeasure_bad_le_sum_planted: unit-costIsQueryBoundedplanted-query union bound overj ∈ Finset.range Q.
Countdown and capture state for a planted-query reduction: skips rem target queries, captures
a Cand value on the next target query (hasCaptured = true), and freezes thereafter.
- rem : ℕ
Number of target queries still to skip before capturing.
- hasCaptured : Bool
Whether the target query at the planted index has already been captured.
- candidate : Cand
Captured candidate value (initialized to a default value while
hasCaptured = false).
Instances For
Initial PlantedState targeting zero-based query index j with fallback defaultCand.
Composite state pairing a PlantedState Cand countdown with an underlying oracle state
State.
- planted : PlantedState Cand
Countdown and capture state of the planted-query reduction.
- oracleState : State
Underlying state of the simulated external oracle.
Instances For
Initial PlantedOracleState at target index j, fallback defaultCand, and oracle state
s.
Lawful lens focusing on the planted field of PlantedOracleState.
Lawful lens focusing on the oracleState field of PlantedOracleState.
Adaptive planted-query countdown handler on PlantedOracleState Cand State:
- once
st.planted.hasCaptured = true, every query returnsdummyReply qand leavesstfrozen; - while
st.planted.hasCaptured = false:- on a target query (
isTarget q = true), capturesextract qwithdummyReply qand freezesst.oracleStateifst.planted.rem == 0, and otherwise stepssim qwhile decrementingst.planted.rem; - on a non-target query (
isTarget q = false), stepssim qzoomed ontooracleStatewhile leaving the countdown untouched.
- on a target query (
Once st.planted.hasCaptured = true, plantedHandler freezes the entire PlantedOracleState
across any subsequent ProbOracleComp execution, so any boolean state predicate test holding at
st holds at termination with probability 1.
Cost-filtered adaptive planted-query union bound. Suppose program : ProbOracleComp spec α
makes at most Q target queries (isTarget q = true), badHandler agrees with sim along
embed : State → BadS whenever (isTarget q && isBad q s) = false, and every bad target query
yields a winning extracted candidate (win (extract q) s = true). Then the probability that
runWith badHandler program (embed s) ends in bad is bounded by the sum over j ∈ Finset.range Q
of the probability that plantedHandler started at PlantedOracleState.init j defaultCand s
captures a winning candidate.
Adaptive Q-query planted-index union bound (IsQueryBounded). When program makes at
most Q external queries (program.IsQueryBounded Q), badHandler agrees with sim along embed
whenever isBad q s = false, and every bad query yields win (extract q) s = true, the probability
of reaching bad from embed s is at most the sum over j ∈ Finset.range Q of the probability
that the j-th planted execution captures a winning candidate.
Variant of toOuterMeasure_bad_le_sum_planted_of_cost for reductions that output
x.2.planted.candidate unconditionally (returning defaultCand when fewer than j + 1 target
queries occur), dropping hasCaptured && in the winning event.