Documentation

Std.Data.DTreeMap.Internal.WF.Defs

Well-formedness predicate on size-bounded trees #

This file defines the well-formedness predicate WF on the internal size-bounded tree data structure Impl and proves well-formedness for those operations that aren't per definition.

A central consequence of well-formedness, balancedness, is shown for all well-formed trees.

inductive Std.DTreeMap.Internal.Impl.WF {α : Type u} [Ord α] {β : αType v} :
Impl α βProp

Well-formedness of tree maps.

Instances For
    theorem Std.DTreeMap.Internal.Impl.WF.balanced {α : Type u} {β : αType v} [Ord α] {t : Impl α β} (h : t.WF) :

    A well-formed tree is balanced. This is needed here already because we need to know that the tree is balanced to call the optimized modification functions.

    theorem Std.DTreeMap.Internal.Impl.WF.eraseMany {α : Type u} {β : αType v} [Ord α] {ρ : Type u_1} [ForIn Id ρ α] {t : Impl α β} {l : ρ} {h : t.Balanced} (hwf : t.WF) :
    (t.eraseMany l h).val.WF
    theorem Std.DTreeMap.Internal.Impl.WF.insertMany {α : Type u} {β : αType v} [Ord α] {ρ : Type u_1} [ForIn Id ρ ((a : α) × β a)] {t : Impl α β} {l : ρ} {h : t.Balanced} (hwf : t.WF) :
    (t.insertMany l h).val.WF
    theorem Std.DTreeMap.Internal.Impl.WF.constInsertMany {α : Type u} [Ord α] {β : Type v} {ρ : Type u_1} [ForIn Id ρ (α × β)] {t : Impl α fun (x : α) => β} {l : ρ} {h : t.Balanced} (hwf : t.WF) :
    theorem Std.DTreeMap.Internal.Impl.WF.constInsertManyIfNewUnit {α : Type u} [Ord α] {ρ : Type u_1} [ForIn Id ρ α] {t : Impl α fun (x : α) => Unit} {l : ρ} {h : t.Balanced} (hwf : t.WF) :
    theorem Std.DTreeMap.Internal.Impl.WF.getThenInsertIfNew? {α : Type u} {β : αType v} [Ord α] [LawfulEqOrd α] {t : Impl α β} {k : α} {v : β k} {h : t.WF} :
    theorem Std.DTreeMap.Internal.Impl.WF.constGetThenInsertIfNew? {α : Type u} {β : Type v} [Ord α] {t : Impl α fun (x : α) => β} {k : α} {v : β} {h : t.WF} :