Range restriction of a concatenation of sorted association lists #
A sorted association list that is stored as a sequence of non-empty blocks, such as the leaves of a B+-tree, is restricted to a closed interval block by block. The blocks that contribute form a contiguous run, and every block of the run other than its first and last is kept whole.
Main result #
Cslib.SortedAssoc.exists_run_range_flatten: the blocks split as a prefix, a run and a suffix; the restriction of the concatenation is that of the run, every block of the run contributes, and every block of the run other than the first and last is unchanged.
theorem Cslib.SortedAssoc.exists_run_range_flatten {α : Type u} {β : Type v} [LinearOrder α] {L : List (List (α × β))} (hs : L.flatten.IsSortedAssoc) (hne : ∀ l ∈ L, l ≠ []) (lo hi : α) :
Restricting a concatenation of non-empty blocks with strictly increasing keys to a closed interval: the blocks split as a prefix, a run and a suffix such that the restriction is that of the run, every block of the run contributes, and every block of the run other than its first and last is kept whole.