Abstract Idea of Merkle Trees #
We provide minimal structure to model Merkle Trees specific to the proof protocol.
For a more complete definition check DataStructures.MerkleTree.Definitions.
- Left : MerkleTree → SidedPath
- Right : MerkleTree → SidedPath
Instances For
@[reducible, inline]
Equations
Instances For
axiom
MerkleAxioms.pathMem
{α : Type}
(v : α)
(ls : List α)
(p : Path)
:
is_valid_path v p (list_tree ls) = true → v ∈ ls
Equations
- ListSimulation.instDecidableEqPath.decEq ListSimulation.Path.Here ListSimulation.Path.Here = isTrue ⋯
- ListSimulation.instDecidableEqPath.decEq ListSimulation.Path.Here a.There = isFalse ⋯
- ListSimulation.instDecidableEqPath.decEq a.There ListSimulation.Path.Here = isFalse ⋯
- ListSimulation.instDecidableEqPath.decEq a.There b.There = if h : a = b then h ▸ have inst := ListSimulation.instDecidableEqPath.decEq a a; isTrue ⋯ else isFalse ⋯
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
- ListSimulation.check_valid_path v ListSimulation.Path.Here (l :: _ls) = decide (v = l)
- ListSimulation.check_valid_path v rs.There (head :: ls_2) = ListSimulation.check_valid_path v rs ls_2
- ListSimulation.check_valid_path v p ls = false
Instances For
theorem
ListSimulation.validProof'
{α : Type}
[DecidableEq α]
{v : α}
{ls : List α}
(vin : v ∈ ls)
:
Equations
Instances For
Equations
- ListSimulation.next_in_path l r = (r = l.There)
Instances For
Equations
- ListSimulation.is_next l r = (r == l.There)
Instances For
Equations
Instances For
Equations
Instances For
Equations
- ListSimulation.last_path_in_list l = List.foldl (fun (p : ListSimulation.Path) (x : α) => p.There) ListSimulation.Path.Here l
Instances For
- NonMemFirst {α : Type} : α → Path → NonMemProof α
- NonMemLast {α : Type} : α → Path → NonMemProof α
- NonBetween {α : Type} : α → Path → α → Path → NonMemProof α
Instances For
Equations
- ListSimulation.minus_path_non_mem p (ListSimulation.NonMemProof.NonMemFirst a p') = ListSimulation.NonMemProof.NonMemFirst a (ListSimulation.path_minus p' p)
- ListSimulation.minus_path_non_mem p (ListSimulation.NonMemProof.NonMemLast a p') = ListSimulation.NonMemProof.NonMemLast a (ListSimulation.path_minus p' p)
- ListSimulation.minus_path_non_mem p (ListSimulation.NonMemProof.NonBetween a ap b bp) = ListSimulation.NonMemProof.NonBetween a (ListSimulation.path_minus ap p) b (ListSimulation.path_minus bp p)
Instances For
def
ListSimulation.check_non_membership
{α : Type}
[LinearOrder α]
(wit : NonMemProof α)
(elem : α)
(ls : List α)
(_ls_non_empty : ¬ls = [])
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
axiom
ListSimulation.validProofNonMem
{α : Type}
[LinearOrder α]
{wit : NonMemProof α}
{e : α}
{ls : List α}
(ls_nempty : ¬ls = [])
(lsS : List.Sorted (fun (x1 x2 : α) => x1 < x2) ls)
(mem : (check_non_membership wit e ls ls_nempty == true) = true)
:
e ∉ ls
axiom
ListSimulation.validProofNonMem'
{α : Type}
[t : LinearOrder α]
{e : α}
{ls : List α}
(ls_nempty : ¬ls = [])
(lsS : List.Sorted (fun (x1 x2 : α) => x1 < x2) ls)
(ein : e ∉ ls)
:
∃ (wit : NonMemProof α), (check_non_membership wit e ls ls_nempty == true) = true
Equations
- SparseTrees.SPTree α = (α → Bool)