All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257

Query Log length le of nma Hash Query Bound

FiatShamir.Fork.queryLog_length_le_of_nmaHashQueryBound

Plain-language statement

Running the inner unifForward + roImpl simulator against a source computation with an nmaHashQueryBound Q can grow the internal queryLog by at most Q. Each source Sum.inr step consumes one unit of the nmaHashQueryBound budget, while roImpl appends to queryLog only on a cache miss, hence at most once per such step.

Exact Lean statement

theorem queryLog_length_le_of_nmaHashQueryBound
    [DecidableEq M] [DecidableEq Commit] [SampleableType Chal] {α : Type}
    {oa : OracleComp (unifSpec + (M × Commit →ₒ Chal)) α} {Q : ℕ}
    (hQ : nmaHashQueryBound (M := M) (Commit := Commit) (Chal := Chal) (oa := oa) Q)
    (st : SimState M Commit Chal) {z : α × SimState M Commit Chal}
    (hz : z ∈ support ((simulateQ (unifForward M Commit Chal + roImpl M Commit Chal) oa).run st)) :
    z.2.2.length ≤ st.2.length + Q

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem queryLog_length_le_of_nmaHashQueryBound    [DecidableEq M] [DecidableEq Commit] [SampleableType Chal] {α : Type}    {oa : OracleComp (unifSpec + (M × Commit Chal)) α} {Q : }    (hQ : nmaHashQueryBound (M := M) (Commit := Commit) (Chal := Chal) (oa := oa) Q)    (st : SimState M Commit Chal) {z : α × SimState M Commit Chal}    (hz : z  support ((simulateQ (unifForward M Commit Chal + roImpl M Commit Chal) oa).run st)) :    z.2.2.length  st.2.length + Q := by  induction oa using OracleComp.inductionOn generalizing Q st z with  | pure x =>      obtain rfl : z = (x, st) := by        simpa [simulateQ_pure, StateT.run_pure, support_pure] using hz      simp  | query_bind t mx ih =>      rw [nmaHashQueryBound_query_bind_iff (M := M) (Commit := Commit) (Chal := Chal)] at hQ      rw [simulateQ_query_bind, StateT.run_bind, support_bind] at hz      simp only [Set.mem_iUnion] at hz      obtain us, hus, hz' := hz      cases t with      | inl n =>          rcases st with cache, log          obtain u, rfl : us  Set.range (fun u => (u, cache, log)) := by            simpa [QueryImpl.add_apply_inl, unifForward, support_map] using hus          simpa using ih u (hQ.2 u) (cache, log) hz'      | inr mc =>          rcases st with cache, log          cases hcache : cache mc with          | some v =>              have hus' : us  ({(v, cache, log)} : Set _) := by                convert hus using 1 <;>                  simp [QueryImpl.add_apply_inr, roImpl, StateT.run_bind, StateT.run_get,                    hcache, support_pure]              obtain rfl := Set.mem_singleton_iff.mp hus'              have hrec : z.2.2.length  log.length + (Q - 1) := by                simpa using ih v (hQ.2 v) (cache, log) hz'              exact le_trans hrec (Nat.add_le_add_left (Nat.sub_le _ _) _)          | none =>              obtain u, rfl : us  Set.range (fun u : Chal =>                  (u, cache.cacheQuery mc u, log ++ [mc])) := by                convert hus using 1 <;>                  simp [QueryImpl.add_apply_inr, roImpl, StateT.run_bind, StateT.run_get,                    hcache, StateT.run_set, support_map]              have hrec : z.2.2.length  (log ++ [mc]).length + (Q - 1) := by                simpa using                  ih u (hQ.2 u)                    ((cache.cacheQuery mc u : (M × Commit Chal).QueryCache), log ++ [mc]) hz'              have hQpos : 0 < Q := hQ.1              simp only [List.length_append, List.length_singleton] at hrec               lia
Project
VCVio
License
Apache-2.0
Commit
2ceb2d825ee3
Source
VCVio/CryptoFoundations/FiatShamir/Sigma/Fork.lean:161-208

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