Documentation

ToMathlib.Data.IndexedBinaryTree.Lemmas

Lemmas about Indexed Binary Trees #

TODOs #

The parent of a left child, when it exists, is the node itself.

The parent of a right child, when it exists, is the node itself.

The parent of a node of depth zero is none.

@[implicit_reducible]
instance BinaryTree.instFunctorLeafData {s : Skeleton} :
Functor fun (α : Type u_1) => LeafData α s
@[implicit_reducible]
@[implicit_reducible]
instance BinaryTree.instFunctorFullData {s : Skeleton} :
Functor fun (α : Type u_1) => FullData α s

Skeleton size: depth and leafCount #

@[simp]
theorem BinaryTree.Skeleton.depth_internal (left right : Skeleton) :
(left.internal right).depth = max left.depth right.depth + 1
@[simp]

Every skeleton has at least one leaf.

The depth of any leaf index is bounded by the depth of its skeleton.

The depth of any node index is bounded by the depth of its skeleton.