The duplicate flag detects exactly equal pairs of complete subtrees
ProvedBsv.Merkle.mutatedCS_eq_mutatedTreebitcoindata-structuresformal-verificationmerkle-tree
Let be an arbitrary binary operation on a type with decidable equality, and let mutatedCS and mutatedTree be as in the imported definitions. For every list of leaves ,
So the flag is set exactly when, at some level, a complete pair of subtrees has equal hashes.
Formalization Note The statement is about the Lean model of the computation, not about a particular program.
Preamble
import Definitions.Def_bsv_merkle_mutation
Formal statement
namespace Bsv.Merkle
theorem mutatedCS_eq_mutatedTree {α : Type} [DecidableEq α] (H : α → α → α) (l : List α) :
mutatedCS H l = mutatedTree H l := by sorry
end Bsv.MerkleSource
Gregory J. Ward, Bryan W. Daugherty, Shawn M. Ryan, BSV Lean proofs (Apache-2.0), theorem mutatedCS_eq_mutatedTree. https://github.com/codenlighten/bsv-lean-proofs