heapifyDown related lemmas #
heapifyUp related lemmas #
Other permutation related lemmas
toSortedArray produces a permutation of the heap.
Constructing a heap from a vector produces a well-formed heap.
Removing the maximum element from a well-formed heap preserves well-formedness.
Replacing the maximum element in a well-formed heap preserves well-formedness.
Elements in popMax were in the original heap
Decreasing a key value in a well-formed heap and reheapifying downward preserves well-formedness.
Increasing a key value in a well-formed heap and reheapifying upward preserves well-formedness.
toSortedArray produces a sorted array if the heap is well-formed
Converting an array to a binary heap produces a well-formed heap.
Converting a vector to a binary heap produces a well-formed heap.
heapSort produces a sorted array.