All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257

Log Has Collision of chain In Log of ne

InductiveMerkleTree.logHasCollision_of_chainInLog_of_ne

Plain-language statement

Log-level binding (Collision Lemma at the log level). Log-formalized analog of getPutativeRootWithHash_binding_collision: two distinct openings (x, proof₁) ≠ (y, proof₂) of the same root at the same index, both witnessed by hash chains ChainInLog in the same log, force log to contain a hash collision (two log entries with equal responses b...

Exact Lean statement

theorem logHasCollision_of_chainInLog_of_ne
    {s : Skeleton} (idx : SkeletonLeafIndex s)
    (log : (spec α).QueryLog) (root x y : α)
    (proof₁ proof₂ : List.Vector α idx.depth)
    (hne : (x, proof₁) ≠ (y, proof₂))
    (hc₁ : ChainInLog log x root idx proof₁)
    (hc₂ : ChainInLog log y root idx proof₂) :
    LogHasCollision log

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem logHasCollision_of_chainInLog_of_ne    {s : Skeleton} (idx : SkeletonLeafIndex s)    (log : (spec α).QueryLog) (root x y : α)    (proof₁ proof₂ : List.Vector α idx.depth)    (hne : (x, proof₁)  (y, proof₂))    (hc₁ : ChainInLog log x root idx proof₁)    (hc₂ : ChainInLog log y root idx proof₂) :    LogHasCollision log := by  induction idx generalizing root x y with  | ofLeaf =>    exact absurd (Prod.ext (hc₁.trans hc₂.symm) (List.Vector.ext (fun i => i.elim0))) hne  | @ofLeft sl sr idxLeft ih =>    obtain a₁, h₁_mem, hc₁ := hc₁    obtain a₂, h₂_mem, hc₂ := hc₂    by_cases hpair : (a₁, proof₁.head) = (a₂, proof₂.head)    · obtain rfl, hhead := Prod.mk.inj hpair      refine ih _ _ _ _ _ (fun heq => hne ?_) hc₁ hc₂      obtain rfl, htail := Prod.mk.inj heq      exact Prod.ext rfl (((List.Vector.eq_cons_iff _ _ _).mpr        hhead, htail).trans proof₂.cons_head_tail)    · exact LogHasCollision.of_mem (fun h => hpair (congrArg Sigma.fst h))        h₁_mem h₂_mem (heq_of_eq rfl)  | @ofRight sl sr idxRight ih =>    obtain a₁, h₁_mem, hc₁ := hc₁    obtain a₂, h₂_mem, hc₂ := hc₂    by_cases hpair : (proof₁.head, a₁) = (proof₂.head, a₂)    · obtain hhead, rfl := Prod.mk.inj hpair      refine ih _ _ _ _ _ (fun heq => hne ?_) hc₁ hc₂      obtain rfl, htail := Prod.mk.inj heq      exact Prod.ext rfl (((List.Vector.eq_cons_iff _ _ _).mpr        hhead, htail).trans proof₂.cons_head_tail)    · exact LogHasCollision.of_mem (fun h => hpair (congrArg Sigma.fst h))        h₁_mem h₂_mem (heq_of_eq rfl)
Project
VCVio
License
Apache-2.0
Commit
2ceb2d825ee3
Source
VCVio/CryptoFoundations/MerkleTree/Inductive/Extractability.lean:393-425

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