All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257

Get Putative Root With Hash batch To Single Proof

InductiveMerkleTree.getPutativeRootWithHash_batchToSingleProof

Plain-language statement

Root preservation. The single-index opening extracted from a batch opening at any selected leaf recomputes exactly the batch opening's putative root. Consequently a batch opening that verifies against a root yields, at every selected leaf, a single-index opening that verifies against the same root.

Exact Lean statement

theorem getPutativeRootWithHash_batchToSingleProof (hashFn : α → α → α)
    {s : Skeleton} {sel : LeafData Bool s}
    (v : SelectedValues α sel) (p : BatchProof α sel)
    (idx : SkeletonLeafIndex s) (hidx : sel.get idx = true) :
    getPutativeRootWithHash idx (selectedValueAt v idx hidx)
      (batchToSingleProof hashFn v p idx hidx) hashFn
    = getPutativeBatchRootWithHash hashFn v p

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem getPutativeRootWithHash_batchToSingleProof (hashFn : α  α  α)    {s : Skeleton} {sel : LeafData Bool s}    (v : SelectedValues α sel) (p : BatchProof α sel)    (idx : SkeletonLeafIndex s) (hidx : sel.get idx = true) :    getPutativeRootWithHash idx (selectedValueAt v idx hidx)      (batchToSingleProof hashFn v p idx hidx) hashFn    = getPutativeBatchRootWithHash hashFn v p := by  induction p with  | leaf =>    cases idx with    | ofLeaf => rfl  | internalBoth pl pr ihl ihr =>    cases idx with    | ofLeft idxL =>      exact congrArg₂ hashFn (ihl v.1 idxL (by simpa using hidx)) rfl    | ofRight idxR =>      exact congrArg₂ hashFn rfl (ihr v.2 idxR (by simpa using hidx))  | pruneRight hr rightRoot pl ih =>    cases idx with    | ofLeft idxL =>      exact congrArg₂ hashFn (ih v.1 idxL (by simpa using hidx)) rfl    | ofRight idxR =>      exact absurd (LeafData.anySelected_of_get idxR (by simpa using hidx)) (by simp [hr])  | pruneLeft hl leftRoot pr ih =>    cases idx with    | ofRight idxR =>      exact congrArg₂ hashFn rfl (ih v.2 idxR (by simpa using hidx))    | ofLeft idxL =>      exact absurd (LeafData.anySelected_of_get idxL (by simpa using hidx)) (by simp [hl])
Project
VCVio
License
Apache-2.0
Commit
2ceb2d825ee3
Source
VCVio/CryptoFoundations/MerkleTree/Inductive/Batch/ToSingle.lean:98-126

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