Skip to content
Merged
9 changes: 9 additions & 0 deletions ToMathlib/Data/IndexedBinaryTree/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ inductive SkeletonInternalIndex : Skeleton → Type
SkeletonInternalIndex (Skeleton.internal left right)
| ofRight {left right : Skeleton} (idxRight : SkeletonInternalIndex right) :
SkeletonInternalIndex (Skeleton.internal left right)
deriving DecidableEq

/-- Type of indices of any node of a skeleton -/
inductive SkeletonNodeIndex : Skeleton → Type
Expand Down Expand Up @@ -583,6 +584,14 @@ def SkeletonInternalIndex.depth {s : Skeleton} : SkeletonInternalIndex s → Nat
| SkeletonInternalIndex.ofLeft idxLeft => idxLeft.depth + 1
| SkeletonInternalIndex.ofRight idxRight => idxRight.depth + 1

/-- The height of the subtree rooted at an internal-node index. -/
@[simp]
def SkeletonInternalIndex.subtreeDepth :
{s : Skeleton} → SkeletonInternalIndex s → Nat
| .internal left right, .ofInternal => (Skeleton.internal left right).depth
| _, .ofLeft idxLeft => idxLeft.subtreeDepth
| _, .ofRight idxRight => idxRight.subtreeDepth

/-- Depth of a SkeletonNodeIndex -/
def SkeletonNodeIndex.depth {s : Skeleton} : SkeletonNodeIndex s → Nat
| SkeletonNodeIndex.ofLeaf => 0
Expand Down
2 changes: 2 additions & 0 deletions VCVio.lean
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public import VCVio.CryptoFoundations.KEMDEM
public import VCVio.CryptoFoundations.KeyEncapMech
public import VCVio.CryptoFoundations.MacAlg
public import VCVio.CryptoFoundations.MacFromPRF
public import VCVio.CryptoFoundations.MerkleTree.Addressed.Basic
public import VCVio.CryptoFoundations.MerkleTree.Addressed.Level
public import VCVio.CryptoFoundations.MerkleTree.Inductive.Batch.Completeness
public import VCVio.CryptoFoundations.MerkleTree.Inductive.Batch.Defs
public import VCVio.CryptoFoundations.MerkleTree.Inductive.Batch.ToSingle
Expand Down
Loading
Loading