Lemmas about Indexed Binary Trees #
TODOs #
- More relationships between tree navigations
- Which navigation sequences are equivalent to each other?
- How do these navigations affect depth?
- API for flattening a tree to a list
- Define
Latticestructure on trees- a subset relation on trees, mappings of indices to indices of supertrees
theorem
BinaryTree.SkeletonNodeIndex.leftChild_bind_parent
{s : Skeleton}
(idx : SkeletonNodeIndex s)
:
The parent of a left child, when it exists, is the node itself.
theorem
BinaryTree.SkeletonNodeIndex.rightChild_bind_parent
{s : Skeleton}
(idx : SkeletonNodeIndex s)
:
The parent of a right child, when it exists, is the node itself.
theorem
BinaryTree.SkeletonNodeIndex.parent_of_depth_zero
{s : Skeleton}
(idx : SkeletonNodeIndex s)
(h : idx.depth = 0)
:
The parent of a node of depth zero is none.
@[implicit_reducible]
instance
BinaryTree.instFunctorInternalData
{s : Skeleton}
:
Functor fun (α : Type u_1) => InternalData α s
instance
BinaryTree.instLawfulFunctorLeafData
{s : Skeleton}
:
LawfulFunctor fun (α : Type u_1) => LeafData α s
instance
BinaryTree.instLawfulFunctorInternalData
{s : Skeleton}
:
LawfulFunctor fun (α : Type u_1) => InternalData α s
instance
BinaryTree.instLawfulFunctorFullData
{s : Skeleton}
:
LawfulFunctor fun (α : Type u_1) => FullData α s
Skeleton size: depth and leafCount #
Every skeleton has at least one leaf.
theorem
BinaryTree.SkeletonLeafIndex.depth_le_skeleton_depth
{s : Skeleton}
(idx : SkeletonLeafIndex s)
:
The depth of any leaf index is bounded by the depth of its skeleton.
theorem
BinaryTree.SkeletonNodeIndex.depth_le_skeleton_depth
{s : Skeleton}
(idx : SkeletonNodeIndex s)
:
The depth of any node index is bounded by the depth of its skeleton.