All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257

Is Query Bound P iff counting filter le

OracleComp.isQueryBoundP_iff_counting_filter_le

Plain-language statement

Predicate-targeted analogue of isTotalQueryBound_iff_counting_total_le: a counting-oracle filtered-sum bound characterizes the structural IsQueryBoundP bound.

Exact Lean statement

theorem isQueryBoundP_iff_counting_filter_le
    [DecidableEq ι] [Fintype ι] [IsUniformSpec spec]
    {oa : OracleComp spec α} {n : ℕ} :
    IsQueryBoundP oa p n ↔
      ∀ z ∈ support (countingOracle.simulate oa 0),
        (∑ i ∈ Finset.univ.filter p, z.2 i) ≤ n

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem isQueryBoundP_iff_counting_filter_le    [DecidableEq ι] [Fintype ι] [IsUniformSpec spec]    {oa : OracleComp spec α} {n : } :    IsQueryBoundP oa p n        z  support (countingOracle.simulate oa 0),        (∑ i  Finset.univ.filter p, z.2 i)  n := by  refine fun h _ hz => IsQueryBoundP.counting_bounded h hz, fun h => ?_  induction oa using OracleComp.inductionOn generalizing n with  | pure _ => trivial  | query_bind t mx ih =>      rw [isQueryBoundP_query_bind_iff]      have hsplit :  (q : QueryCount ι),          (∑ i  Finset.univ.filter p, (QueryCount.single t + q) i) =          (∑ i  Finset.univ.filter p, QueryCount.single t i) +          (∑ i  Finset.univ.filter p, q i) := by        intro q        simp [Pi.add_apply, Finset.sum_add_distrib]      refine ?_, fun u => ?_      · by_cases hpt : p t        · refine Or.inr ?_          obtain z₀, hz₀ := countingOracle.support_simulate_nonempty (mx default)          have hbig : (z₀.1, QueryCount.single t + z₀.2)               support (countingOracle.simulate ((query t : OracleComp spec _) >>= mx) 0) :=            countingOracle.add_single_mem_support_simulate_queryBind hz₀          have hbound := h _ hbig          rw [hsplit, sum_single_filter_eq_one hpt] at hbound          omega        · exact Or.inl hpt      · apply ih u        intro z hz        have hbig' : (z.1, QueryCount.single t + z.2)             support (countingOracle.simulate ((query t : OracleComp spec _) >>= mx) 0) :=          countingOracle.add_single_mem_support_simulate_queryBind hz        have hbound := h _ hbig'        rw [hsplit] at hbound        by_cases hpt : p t        · simp only [if_pos hpt]          rw [sum_single_filter_eq_one hpt] at hbound          omega        · simp only [if_neg hpt]          rwa [sum_single_filter_eq_zero hpt, zero_add] at hbound
Project
VCVio
License
Apache-2.0
Commit
2ceb2d825ee3
Source
VCVio/OracleComp/QueryTracking/QueryBound.lean:1284-1324

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