Is Query Bound P counting bounded
OracleComp.IsQueryBoundP.counting_bounded
Plain-language statement
Soundness: any path of the counting-oracle simulation of a p-bounded computation has sum of per-index counts over p-indices at most n.
Exact Lean statement
theorem IsQueryBoundP.counting_bounded [DecidableEq ι] [Fintype ι]
{oa : OracleComp spec α} {n : ℕ}
(h : IsQueryBoundP oa p n)
{z : α × QueryCount ι}
(hz : z ∈ support (countingOracle.simulate oa 0)) :
(∑ i ∈ Finset.univ.filter p, z.2 i) ≤ nFormal artifact
Lean source
theorem IsQueryBoundP.counting_bounded [DecidableEq ι] [Fintype ι] {oa : OracleComp spec α} {n : ℕ} (h : IsQueryBoundP oa p n) {z : α × QueryCount ι} (hz : z ∈ support (countingOracle.simulate oa 0)) : (∑ i ∈ Finset.univ.filter p, z.2 i) ≤ n := by induction oa using OracleComp.inductionOn generalizing n z with | pure x => rw [countingOracle.mem_support_simulate_pure_iff] at hz subst hz simp | query_bind t mx ih => rw [isQueryBoundP_query_bind_iff] at h rw [countingOracle.mem_support_simulate_queryBind_iff] at hz obtain ⟨hne, u, hu⟩ := hz have hrec : (∑ i ∈ Finset.univ.filter p, (Function.update z.2 t (z.2 t - 1)) i) ≤ (if p t then n - 1 else n) := ih u (h.2 u) hu have hz_pos : 0 < z.2 t := Nat.pos_of_ne_zero hne by_cases hpt : p t · simp only [if_pos hpt] at hrec rw [sum_filter_update_of_pred_pos hpt hz_pos] at hrec have hp_pos : 0 < ∑ i ∈ Finset.univ.filter p, z.2 i := Nat.lt_of_lt_of_le hz_pos (Finset.single_le_sum (f := z.2) (fun _ _ => Nat.zero_le _) (Finset.mem_filter.mpr ⟨Finset.mem_univ t, hpt⟩)) have hn_pos : 0 < n := h.1.resolve_left (fun hnp => hnp hpt) have hshift : (∑ i ∈ Finset.univ.filter p, z.2 i) - 1 + 1 ≤ (n - 1) + 1 := Nat.add_le_add_right hrec 1 rwa [Nat.sub_add_cancel hp_pos, Nat.sub_add_cancel hn_pos] at hshift · simp only [if_neg hpt] at hrec rwa [sum_filter_update_of_not_pred hpt] at hrec- Project
- VCVio
- License
- Apache-2.0
- Commit
- 2ceb2d825ee3
- Source
- VCVio/OracleComp/QueryTracking/QueryBound.lean:1213-1245
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.