Documentation

Std.Data.DTreeMap.Internal.WF.Lemmas

Lemmas relating operations on well-formed size-bounded trees to operations on lists #

This file contains lemmas that relate Impl.toListModel to the queries and operations on Impl. The Impl.Ordered property, being defined in terms of Impl.toListModel, is then shown to be preserved by all of the operations.

However, this file does not contain lemmas that relate operations besides Impl.toListModel to each other or themselves. Such proofs crucially build on top of the lemmas in this file and can be found in Std.Data.Internal.Lemmas.

toListModel for balancing operations #

@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_balance {α : Type u} {β : αType v} {k : α} {v : β k} {l r : Impl α β} {hlb : l.Balanced} {hrb : r.Balanced} {hlr : BalanceLErasePrecond l.size r.size BalanceLErasePrecond r.size l.size} :
(balance k v l r hlb hrb hlr).toListModel = l.toListModel ++ k, v :: r.toListModel
@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_balanceL {α : Type u} {β : αType v} {k : α} {v : β k} {l r : Impl α β} {hlb : l.Balanced} {hrb : r.Balanced} {hlr : BalanceLPrecond l.size r.size} :
(balanceL k v l r hlb hrb hlr).toListModel = l.toListModel ++ k, v :: r.toListModel
@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_balanceLErase {α : Type u} {β : αType v} {k : α} {v : β k} {l r : Impl α β} {hlb : l.Balanced} {hrb : r.Balanced} {hlr : BalanceLErasePrecond l.size r.size} :
(balanceLErase k v l r hlb hrb hlr).toListModel = l.toListModel ++ k, v :: r.toListModel
@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_balanceR {α : Type u} {β : αType v} {k : α} {v : β k} {l r : Impl α β} {hlb : l.Balanced} {hrb : r.Balanced} {hlr : BalanceLPrecond r.size l.size} :
(balanceR k v l r hlb hrb hlr).toListModel = l.toListModel ++ k, v :: r.toListModel
@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_balanceRErase {α : Type u} {β : αType v} {k : α} {v : β k} {l r : Impl α β} {hlb : l.Balanced} {hrb : r.Balanced} {hlr : BalanceLErasePrecond r.size l.size} :
(balanceRErase k v l r hlb hrb hlr).toListModel = l.toListModel ++ k, v :: r.toListModel
@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_minView {α : Type u} {β : αType v} {k : α} {v : β k} {l r : Impl α β} {hl : l.Balanced} {hr : r.Balanced} {hlr : BalancedAtRoot l.size r.size} :
(minView k v l r hl hr hlr).k, (minView k v l r hl hr hlr).v :: (minView k v l r hl hr hlr).tree.impl.toListModel = l.toListModel ++ k, v :: r.toListModel
@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_maxView {α : Type u} {β : αType v} {k : α} {v : β k} {l r : Impl α β} {hl : l.Balanced} {hr : r.Balanced} {hlr : BalancedAtRoot l.size r.size} :
(maxView k v l r hl hr hlr).tree.impl.toListModel ++ [(maxView k v l r hl hr hlr).k, (maxView k v l r hl hr hlr).v] = l.toListModel ++ k, v :: r.toListModel
@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_glue {α : Type u} {β : αType v} {l r : Impl α β} {hl : l.Balanced} {hr : r.Balanced} {hlr : BalancedAtRoot l.size r.size} :
@[simp, irreducible]
theorem Std.DTreeMap.Internal.Impl.toListModel_link2 {α : Type u} {β : αType v} [Ord α] {l r : Impl α β} {hl : l.Balanced} {hr : r.Balanced} :
@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_insertMin {α : Type u} {β : αType v} [Ord α] {k : α} {v : β k} {t : Impl α β} {h : t.Balanced} :
(insertMin k v t h).impl.toListModel = k, v :: t.toListModel
@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_insertMax {α : Type u} {β : αType v} [Ord α] {k : α} {v : β k} {t : Impl α β} {h : t.Balanced} :
(insertMax k v t h).impl.toListModel = t.toListModel ++ [k, v]

Verification of model functions #

theorem Std.DTreeMap.Internal.Impl.toListModel_filter_gt_of_gt {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.gt) (ho : (inner sz k' v' l r).Ordered) :
List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.gt) (inner sz k' v' l r).toListModel = l.toListModel ++ k', v' :: List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.gt) r.toListModel
theorem Std.DTreeMap.Internal.Impl.toListModel_filter_gt_of_eq {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.eq) (ho : (inner sz k' v' l r).Ordered) :
List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.gt) (inner sz k' v' l r).toListModel = l.toListModel
theorem Std.DTreeMap.Internal.Impl.toListModel_filter_gt_of_lt {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.lt) (ho : (inner sz k' v' l r).Ordered) :
List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.gt) (inner sz k' v' l r).toListModel = List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.gt) l.toListModel
theorem Std.DTreeMap.Internal.Impl.toListModel_find?_of_gt {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.gt) (ho : (inner sz k' v' l r).Ordered) :
List.find? (fun (x : (a : α) × β a) => k x.fst == Ordering.eq) (inner sz k' v' l r).toListModel = List.find? (fun (x : (a : α) × β a) => k x.fst == Ordering.eq) r.toListModel
theorem Std.DTreeMap.Internal.Impl.toListModel_find?_of_eq {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.eq) (ho : (inner sz k' v' l r).Ordered) :
List.find? (fun (x : (a : α) × β a) => k x.fst == Ordering.eq) (inner sz k' v' l r).toListModel = some k', v'
theorem Std.DTreeMap.Internal.Impl.toListModel_find?_of_lt {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.lt) (ho : (inner sz k' v' l r).Ordered) :
List.find? (fun (x : (a : α) × β a) => k x.fst == Ordering.eq) (inner sz k' v' l r).toListModel = List.find? (fun (x : (a : α) × β a) => k x.fst == Ordering.eq) l.toListModel
theorem Std.DTreeMap.Internal.Impl.toListModel_filter_lt_of_gt {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.gt) (ho : (inner sz k' v' l r).Ordered) :
List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.lt) (inner sz k' v' l r).toListModel = List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.lt) r.toListModel
theorem Std.DTreeMap.Internal.Impl.toListModel_filter_lt_of_eq {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.eq) (ho : (inner sz k' v' l r).Ordered) :
List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.lt) (inner sz k' v' l r).toListModel = r.toListModel
theorem Std.DTreeMap.Internal.Impl.toListModel_filter_lt_of_lt {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.lt) (ho : (inner sz k' v' l r).Ordered) :
List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.lt) (inner sz k' v' l r).toListModel = List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.lt) l.toListModel ++ k', v' :: r.toListModel
theorem Std.DTreeMap.Internal.Impl.findCell_of_gt {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.gt) (ho : (inner sz k' v' l r).Ordered) :
theorem Std.DTreeMap.Internal.Impl.findCell_of_eq {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.eq) (ho : (inner sz k' v' l r).Ordered) :
List.findCell (inner sz k' v' l r).toListModel k = Cell.ofEq k' v'
theorem Std.DTreeMap.Internal.Impl.findCell_of_lt {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsCut compare k] {sz : Nat} {k' : α} {v' : β k'} {l r : Impl α β} (hcmp : k k' = Ordering.lt) (ho : (inner sz k' v' l r).Ordered) :
theorem Std.DTreeMap.Internal.Impl.toListModel_updateCell {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {f : Cell α β (compare k)Cell α β (compare k)} {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) :
(updateCell k f l hlb).impl.toListModel = List.filter (fun (x : (a : α) × β a) => compare k x.fst == Ordering.gt) l.toListModel ++ (f (List.findCell l.toListModel (compare k))).inner.toList ++ List.filter (fun (x : (a : α) × β a) => compare k x.fst == Ordering.lt) l.toListModel
theorem Std.DTreeMap.Internal.Impl.toListModel_eq_append {α : Type u} {β : αType v} [Ord α] [TransOrd α] (k : αOrdering) [Internal.IsStrictCut compare k] {l : Impl α β} (ho : l.Ordered) :
l.toListModel = List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.gt) l.toListModel ++ (List.find? (fun (x : (a : α) × β a) => k x.fst == Ordering.eq) l.toListModel).toList ++ List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.lt) l.toListModel
theorem Std.DTreeMap.Internal.Impl.ordered_updateAtKey {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {f : Cell α β (compare k)Cell α β (compare k)} {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) :
(updateCell k f l hlb).impl.Ordered

Connecting the tree maps machinery to the hash map machinery #

theorem Std.DTreeMap.Internal.Impl.exists_cell_of_updateAtKey {α : Type u} {β : αType v} [Ord α] [TransOrd α] (l : Impl α β) (hlb : l.Balanced) (hlo : l.Ordered) (k : α) (f : Cell α β (compare k)Cell α β (compare k)) :
(l' : List ((a : α) × β a)), l.toListModel.Perm ((List.find? (fun (x : (a : α) × β a) => compare k x.fst == Ordering.eq) l.toListModel).toList ++ l') (updateCell k f l hlb).impl.toListModel.Perm ((f (List.findCell l.toListModel (compare k))).inner.toList ++ l') Internal.List.containsKey k l' = false
theorem Std.DTreeMap.Internal.Impl.toListModel_updateAtKey_perm {α : Type u} {β : αType v} [Ord α] [TransOrd α] {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) {k : α} {f : Cell α β (compare k)Cell α β (compare k)} {g : List ((a : α) × β a)List ((a : α) × β a)} (hfg : ∀ {c : Cell α β (compare k)}, (f c).inner.toList = g c.inner.toList) (hg₁ : ∀ {l l' : List ((a : α) × β a)}, Internal.List.DistinctKeys ll.Perm l'(g l).Perm (g l')) (hg₂ : ∀ {l l' : List ((a : α) × β a)}, Internal.List.containsKey k l' = falseg (l ++ l') = g l ++ l') :

This is the general theorem to show that modification operations are correct.

theorem Std.DTreeMap.Internal.Impl.contains_findCell {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {l : Impl α β} (hlo : l.Ordered) (h : contains' k l = true) :
theorem Std.DTreeMap.Internal.Impl.applyPartition_eq {α : Type u} {β : αType v} {δ : Type w} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {l : Impl α β} {f : List ((a : α) × β a)(c : Cell α β k) → (contains' k l = truec.contains = true)List ((a : α) × β a)δ} (hlo : l.Ordered) :
applyPartition k l f = f (List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.gt) l.toListModel) (List.findCell l.toListModel k) (List.filter (fun (x : (a : α) × β a) => k x.fst == Ordering.lt) l.toListModel)
theorem Std.DTreeMap.Internal.Impl.applyPartition_eq_apply_toListModel {α : Type u} {β : αType v} {δ : Type w} [Ord α] [TransOrd α] {k : α} {l : Impl α β} (hlo : l.Ordered) {f : List ((a : α) × β a)(c : Cell α β (compare k)) → (contains' (compare k) l = truec.contains = true)List ((a : α) × β a)δ} (g : (ll : List ((a : α) × β a)) → (contains' (compare k) l = trueInternal.List.containsKey k ll = true)δ) (h : ∀ {ll rr : List ((a : α) × β a)} {c : Cell α β (compare k)} {h₁ : contains' (compare k) l = truec.contains = true}, List.Pairwise (fun (a b : (a : α) × β a) => compare a.fst b.fst = Ordering.lt) (ll ++ c.inner.toList ++ rr)(∀ (p : (a : α) × β a), p llcompare k p.fst = Ordering.gt)(∀ (p : (a : α) × β a), p rrcompare k p.fst = Ordering.lt)f ll c h₁ rr = g (ll ++ c.inner.toList ++ rr) ) :
theorem Std.DTreeMap.Internal.Impl.applyPartition_eq_apply_toListModel' {α : Type u} {β : αType v} {δ : Type w} [Ord α] [TransOrd α] {k : αOrdering} [Internal.IsStrictCut compare k] {l : Impl α β} (hlo : l.Ordered) {f : List ((a : α) × β a)(c : Cell α β k) → (contains' k l = truec.contains = true)List ((a : α) × β a)δ} (g : List ((a : α) × β a)δ) (h : ∀ {ll rr : List ((a : α) × β a)} {c : Cell α β k} {h₁ : contains' k l = truec.contains = true}, List.Pairwise (fun (a b : (a : α) × β a) => compare a.fst b.fst = Ordering.lt) (ll ++ c.inner.toList ++ rr)(∀ (p : (a : α) × β a), p llk p.fst = Ordering.gt)(∀ (p : (a : α) × β a), p rrk p.fst = Ordering.lt)f ll c h₁ rr = g (ll ++ c.inner.toList ++ rr)) :
theorem Std.DTreeMap.Internal.Impl.applyCell_eq_apply_toListModel {α : Type u} {β : αType v} {δ : Type w} [Ord α] [TransOrd α] {k : α} {l : Impl α β} (hlo : l.Ordered) {f : (c : Cell α β (compare k)) → (contains' (compare k) l = truec.contains = true)δ} (g : (ll : List ((a : α) × β a)) → (contains' (compare k) l = trueInternal.List.containsKey k ll = true)δ) (hfg : ∀ (c : Cell α β (compare k)) (hc : contains' (compare k) l = truec.contains = true), f c hc = g c.inner.toList ) (hg₁ : ∀ (l₁ l₂ : List ((a : α) × β a)) (h : contains' (compare k) l = trueInternal.List.containsKey k l₁ = true), Internal.List.DistinctKeys l₁∀ (hP : l₁.Perm l₂), g l₁ h = g l₂ ) (hg : ∀ (l₁ l₂ : List ((a : α) × β a)) (h : contains' (compare k) l = trueInternal.List.containsKey k (l₁ ++ l₂) = true) (h' : Internal.List.containsKey k l₂ = false), g (l₁ ++ l₂) h = g l₁ ) :
applyCell k l f = g l.toListModel

Verification of access operations #

isEmpty #

size #

theorem Std.DTreeMap.Internal.Impl.size_eq_length {α : Type u} {β : αType v} (t : Impl α β) (htb : t.Balanced) :

contains #

theorem Std.DTreeMap.Internal.Impl.containsₘ_eq_containsKey {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {l : Impl α β} (hlo : l.Ordered) :
theorem Std.DTreeMap.Internal.Impl.contains_eq_containsKey {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {l : Impl α β} (hlo : l.Ordered) :

get? #

theorem Std.DTreeMap.Internal.Impl.get?ₘ_eq_getValueCast? {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {k : α} {t : Impl α β} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.get?_eq_getValueCast? {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {k : α} {t : Impl α β} (hto : t.Ordered) :

get #

theorem Std.DTreeMap.Internal.Impl.contains_eq_isSome_get?ₘ {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {k : α} {t : Impl α β} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.getₘ_eq_getValueCast {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {k : α} {t : Impl α β} (h : Internal.List.containsKey k t.toListModel = true) {h' : (t.get?ₘ k).isSome = true} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.get_eq_getValueCast {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {k : α} {t : Impl α β} {h : contains k t = true} (hto : t.Ordered) :

get! #

theorem Std.DTreeMap.Internal.Impl.get!ₘ_eq_getValueCast! {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {k : α} [Inhabited (β k)] {t : Impl α β} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.get!_eq_getValueCast! {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {k : α} [Inhabited (β k)] {t : Impl α β} (hto : t.Ordered) :

getD #

theorem Std.DTreeMap.Internal.Impl.getDₘ_eq_getValueCastD {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {k : α} {t : Impl α β} {fallback : β k} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.getD_eq_getValueCastD {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {k : α} {t : Impl α β} {fallback : β k} (hto : t.Ordered) :
t.getD k fallback = Internal.List.getValueCastD k t.toListModel fallback

getKey? #

theorem Std.DTreeMap.Internal.Impl.getKey?ₘ_eq_getKey? {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.getKey?_eq_getKey? {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} (hto : t.Ordered) :

getKey #

theorem Std.DTreeMap.Internal.Impl.contains_eq_isSome_getKey?ₘ {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.getKeyₘ_eq_getKey {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} (h : Internal.List.containsKey k t.toListModel = true) {h' : (t.getKey?ₘ k).isSome = true} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.getKey_eq_getKey {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} {h : contains k t = true} (hto : t.Ordered) :

getKey! #

theorem Std.DTreeMap.Internal.Impl.getKey!ₘ_eq_getKey! {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} [Inhabited α] {t : Impl α β} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.getKey!_eq_getKey! {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} [Inhabited α] {t : Impl α β} (hto : t.Ordered) :

getKeyD #

theorem Std.DTreeMap.Internal.Impl.getKeyDₘ_eq_getKeyD {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} {fallback : α} (hto : t.Ordered) :
getKeyDₘ k t fallback = Internal.List.getKeyD k t.toListModel fallback
theorem Std.DTreeMap.Internal.Impl.getKeyD_eq_getKeyD {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} {fallback : α} (hto : t.Ordered) :
t.getKeyD k fallback = Internal.List.getKeyD k t.toListModel fallback

get? #

theorem Std.DTreeMap.Internal.Impl.Const.get?ₘ_eq_getValue? {α : Type u} {β : Type v} [Ord α] [TransOrd α] {k : α} {t : Impl α fun (x : α) => β} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.Const.get?_eq_getValue? {α : Type u} {β : Type v} [Ord α] [TransOrd α] {k : α} {t : Impl α fun (x : α) => β} (hto : t.Ordered) :

get #

theorem Std.DTreeMap.Internal.Impl.Const.contains_eq_isSome_get?ₘ {α : Type u} {β : Type v} [Ord α] [TransOrd α] {k : α} {t : Impl α fun (x : α) => β} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.Const.getₘ_eq_getValue {α : Type u} {β : Type v} [Ord α] [TransOrd α] {k : α} {t : Impl α fun (x : α) => β} (h : Internal.List.containsKey k t.toListModel = true) {h' : (get?ₘ t k).isSome = true} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.Const.get_eq_getValue {α : Type u} {β : Type v} [Ord α] [TransOrd α] {k : α} {t : Impl α fun (x : α) => β} {h : contains k t = true} (hto : t.Ordered) :

get! #

theorem Std.DTreeMap.Internal.Impl.Const.get!ₘ_eq_getValue! {α : Type u} {β : Type v} [Ord α] [TransOrd α] {k : α} [Inhabited β] {t : Impl α fun (x : α) => β} (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.Const.get!_eq_getValue! {α : Type u} {β : Type v} [Ord α] [TransOrd α] {k : α} [Inhabited β] {t : Impl α fun (x : α) => β} (hto : t.Ordered) :

getD #

theorem Std.DTreeMap.Internal.Impl.Const.getDₘ_eq_getValueD {α : Type u} {β : Type v} [Ord α] [TransOrd α] {k : α} {t : Impl α fun (x : α) => β} {fallback : β} (hto : t.Ordered) :
getDₘ t k fallback = Internal.List.getValueD k t.toListModel fallback
theorem Std.DTreeMap.Internal.Impl.Const.getD_eq_getValueD {α : Type u} {β : Type v} [Ord α] [TransOrd α] {k : α} {t : Impl α fun (x : α) => β} {fallback : β} (hto : t.Ordered) :
getD t k fallback = Internal.List.getValueD k t.toListModel fallback

Verification of modification operations #

empty #

insertₘ #

theorem Std.DTreeMap.Internal.Impl.ordered_insertₘ {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) :
(insertₘ k v l hlb).Ordered
theorem Std.DTreeMap.Internal.Impl.toListModel_insertₘ {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) :

insert #

theorem Std.DTreeMap.Internal.Impl.ordered_insert {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) :
(insert k v l hlb).impl.Ordered
theorem Std.DTreeMap.Internal.Impl.toListModel_insert {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) :

insert! #

theorem Std.DTreeMap.Internal.Impl.WF.insert! {α : Type u} {β : αType v} {x✝ : Ord α} [TransOrd α] {k : α} {v : β k} {l : Impl α β} (h : l.WF) :
theorem Std.DTreeMap.Internal.Impl.toListModel_insert! {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) :

eraseₘ #

theorem Std.DTreeMap.Internal.Impl.ordered_eraseₘ {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} (htb : t.Balanced) (hto : t.Ordered) :
(eraseₘ k t htb).Ordered
theorem Std.DTreeMap.Internal.Impl.toListModel_eraseₘ {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} (htb : t.Balanced) (hto : t.Ordered) :

erase #

theorem Std.DTreeMap.Internal.Impl.ordered_erase {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} (htb : t.Balanced) (hto : t.Ordered) :
(erase k t htb).impl.Ordered
theorem Std.DTreeMap.Internal.Impl.toListModel_erase {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {t : Impl α β} (htb : t.Balanced) (hto : t.Ordered) :

erase! #

theorem Std.DTreeMap.Internal.Impl.WF.erase! {α : Type u} {β : αType v} {x✝ : Ord α} [TransOrd α] {k : α} {l : Impl α β} (h : l.WF) :
theorem Std.DTreeMap.Internal.Impl.toListModel_erase! {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) :

containsThenInsert #

theorem Std.DTreeMap.Internal.Impl.containsThenInsert_fst_eq_containsₘ {α : Type u} {β : αType v} [Ord α] [TransOrd α] (t : Impl α β) (htb : t.Balanced) (ho : t.Ordered) (a : α) (b : β a) :
theorem Std.DTreeMap.Internal.Impl.ordered_containsThenInsert {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {t : Impl α β} (htb : t.Balanced) (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.toListModel_containsThenInsert {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {t : Impl α β} (htb : t.Balanced) (hto : t.Ordered) :

containsThenInsert! #

theorem Std.DTreeMap.Internal.Impl.WF.containsThenInsert! {α : Type u} {β : αType v} {x✝ : Ord α} [TransOrd α] {k : α} {v : β k} {t : Impl α β} (h : t.WF) :
theorem Std.DTreeMap.Internal.Impl.toListModel_containsThenInsert! {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {t : Impl α β} (htb : t.Balanced) (hto : t.Ordered) :

insertIfNew #

theorem Std.DTreeMap.Internal.Impl.ordered_insertIfNew {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (h : l.Balanced) (ho : l.Ordered) :
theorem Std.DTreeMap.Internal.Impl.toListModel_insertIfNew {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) :

insertIfNew! #

theorem Std.DTreeMap.Internal.Impl.ordered_insertIfNew! {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (h : l.Balanced) (ho : l.Ordered) :
theorem Std.DTreeMap.Internal.Impl.WF.insertIfNew! {α : Type u} {β : αType v} {x✝ : Ord α} [TransOrd α] {k : α} {v : β k} {l : Impl α β} (h : l.WF) :
theorem Std.DTreeMap.Internal.Impl.toListModel_insertIfNew! {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (hlb : l.Balanced) (hlo : l.Ordered) :

containsThenInsertIfNew #

theorem Std.DTreeMap.Internal.Impl.ordered_containsThenInsertIfNew {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (h : l.Balanced) (ho : l.Ordered) :
theorem Std.DTreeMap.Internal.Impl.toListModel_containsThenInsertIfNew {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {t : Impl α β} (htb : t.Balanced) (hto : t.Ordered) :

containsThenInsertIfNew! #

theorem Std.DTreeMap.Internal.Impl.ordered_containsThenInsertIfNew! {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {l : Impl α β} (h : l.Balanced) (ho : l.Ordered) :
theorem Std.DTreeMap.Internal.Impl.WF.containsThenInsertIfNew! {α : Type u} {β : αType v} {x✝ : Ord α} [TransOrd α] {k : α} {v : β k} {l : Impl α β} (h : l.WF) :
theorem Std.DTreeMap.Internal.Impl.toListModel_containsThenInsertIfNew! {α : Type u} {β : αType v} [Ord α] [TransOrd α] {k : α} {v : β k} {t : Impl α β} (htb : t.Balanced) (hto : t.Ordered) :

filterMap #

@[simp]
theorem Std.DTreeMap.Internal.Impl.toListModel_filterMap {α : Type u} {β : αType v} {γ : αType w} [Ord α] {t : Impl α β} {h : t.Balanced} {f : (a : α) → β aOption (γ a)} :
(filterMap f t h).impl.toListModel = List.filterMap (fun (x : (a : α) × β a) => Option.map (fun (x_1 : γ x.fst) => x.fst, x_1) (f x.fst x.snd)) t.toListModel
theorem Std.DTreeMap.Internal.Impl.balanced_filterMap {α : Type u} {β : αType v} {γ : αType w} [Ord α] {t : Impl α β} {h : t.Balanced} {f : (a : α) → β aOption (γ a)} :
theorem Std.DTreeMap.Internal.Impl.ordered_filterMap {α : Type u} {β : αType v} {γ : αType w} [Ord α] {t : Impl α β} {h : t.Balanced} {f : (a : α) → β aOption (γ a)} (ho : t.Ordered) :

filter #

theorem Std.DTreeMap.Internal.Impl.filter_eq_filterMap {α : Type u} {β : αType v} [Ord α] {t : Impl α β} {h : t.Balanced} {f : (a : α) → β aBool} :
filter f t h = filterMap (fun (k : α) (v : β k) => if f k v = true then some v else none) t h
theorem Std.DTreeMap.Internal.Impl.ordered_filter {α : Type u} {β : αType v} [Ord α] {t : Impl α β} {h : t.Balanced} {f : (a : α) → β aBool} (hto : t.Ordered) :

alter #

theorem Std.DTreeMap.Internal.Impl.toListModel_alterₘ {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {t : Impl α β} {a : α} {f : Option (β a)Option (β a)} (htb : t.Balanced) (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.alter_eq_alterₘ {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {t : Impl α β} {a : α} {f : Option (β a)Option (β a)} (htb : t.Balanced) (hto : t.Ordered) :
(alter a f t htb).impl = alterₘ a f t htb
theorem Std.DTreeMap.Internal.Impl.toListModel_alter {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {t : Impl α β} {a : α} {f : Option (β a)Option (β a)} (htb : t.Balanced) (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.ordered_alter {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {t : Impl α β} {a : α} {f : Option (β a)Option (β a)} (htb : t.Balanced) (hto : t.Ordered) :
(alter a f t htb).impl.Ordered

alter! #

theorem Std.DTreeMap.Internal.Impl.alter_eq_alter! {α : Type u} {β : αType v} [Ord α] [LawfulEqOrd α] {t : Impl α β} {a : α} {f : Option (β a)Option (β a)} (htb : t.Balanced) :
(alter a f t htb).impl = alter! a f t

modify #

theorem Std.DTreeMap.Internal.Impl.modify_eq_alter {α : Type u} {β : αType v} [Ord α] [LawfulEqOrd α] {t : Impl α β} {a : α} {f : β aβ a} (htb : t.Balanced) :
modify a f t = (alter a (fun (x : Option (β a)) => Option.map f x) t htb).impl
theorem Std.DTreeMap.Internal.Impl.ordered_modify {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {t : Impl α β} {a : α} {f : β aβ a} (htb : t.Balanced) (hto : t.Ordered) :
(modify a f t).Ordered

mergeWith #

theorem Std.DTreeMap.Internal.Impl.ordered_mergeWith {α : Type u} {β : αType v} [Ord α] [TransOrd α] [LawfulEqOrd α] {t₁ t₂ : Impl α β} {f : (a : α) → β aβ aβ a} (htb : t₁.Balanced) (hto : t₁.Ordered) :
(mergeWith f t₁ t₂ htb).impl.Ordered

foldlM #

theorem Std.DTreeMap.Internal.Impl.foldlM_eq_foldlM {α : Type u} {β : αType v} {t : Impl α β} {m : Type u_1 → Type u_2} {δ : Type u_1} [Monad m] [LawfulMonad m] {f : δ(a : α) → β am δ} {init : δ} :
foldlM f init t = List.foldlM (fun (acc : δ) (p : (a : α) × β a) => f acc p.fst p.snd) init t.toListModel

foldl #

theorem Std.DTreeMap.Internal.Impl.foldl_eq_foldl {α : Type u} {β : αType v} {t : Impl α β} {δ : Type u_1} {f : δ(a : α) → β aδ} {init : δ} :
foldl f init t = List.foldl (fun (acc : δ) (p : (a : α) × β a) => f acc p.fst p.snd) init t.toListModel

foldrM #

theorem Std.DTreeMap.Internal.Impl.foldrM_eq_foldrM {α : Type u} {β : αType v} {t : Impl α β} {m : Type u_1 → Type u_2} {δ : Type u_1} [Monad m] [LawfulMonad m] {f : (a : α) → β aδm δ} {init : δ} :
foldrM f init t = List.foldrM (fun (p : (a : α) × β a) (acc : δ) => f p.fst p.snd acc) init t.toListModel

foldr #

theorem Std.DTreeMap.Internal.Impl.foldr_eq_foldr {α : Type u} {β : αType v} {t : Impl α β} {δ : Type u_1} {f : (a : α) → β aδδ} {init : δ} :
foldr f init t = List.foldr (fun (p : (a : α) × β a) (acc : δ) => f p.fst p.snd acc) init t.toListModel

toList #

theorem Std.DTreeMap.Internal.Impl.toList_eq_toListModel {α : Type u} {β : αType v} {t : Impl α β} :

keys #

getThenInsertIfNew?! #

theorem Std.DTreeMap.Internal.Impl.Const.WF.getThenInsertIfNew?! {α : Type u} {β : Type v} [Ord α] [TransOrd α] [LawfulEqOrd α] {k : α} {v : β} {t : Impl α fun (x : α) => β} (h : t.WF) :

alter #

theorem Std.DTreeMap.Internal.Impl.Const.toListModel_alterₘ {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : Impl α fun (x : α) => β} {a : α} {f : Option βOption β} (htb : t.Balanced) (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.Const.alter_eq_alterₘ {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : Impl α fun (x : α) => β} {a : α} {f : Option βOption β} (htb : t.Balanced) (hto : t.Ordered) :
(alter a f t htb).impl = alterₘ a f t htb
theorem Std.DTreeMap.Internal.Impl.Const.toListModel_alter {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : Impl α fun (x : α) => β} {a : α} {f : Option βOption β} (htb : t.Balanced) (hto : t.Ordered) :
theorem Std.DTreeMap.Internal.Impl.Const.ordered_alter {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : Impl α fun (x : α) => β} {a : α} {f : Option βOption β} (htb : t.Balanced) (hto : t.Ordered) :
(alter a f t htb).impl.Ordered

alter! #

theorem Std.DTreeMap.Internal.Impl.Const.alter_eq_alter! {α : Type u} {β : Type v} [Ord α] {t : Impl α fun (x : α) => β} {a : α} {f : Option βOption β} (htb : t.Balanced) :
(alter a f t htb).impl = alter! a f t

modify #

theorem Std.DTreeMap.Internal.Impl.Const.modify_eq_alter {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : Impl α fun (x : α) => β} {a : α} {f : ββ} (htb : t.Balanced) :
modify a f t = (alter a (fun (x : Option β) => Option.map f x) t htb).impl
theorem Std.DTreeMap.Internal.Impl.Const.ordered_modify {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t : Impl α fun (x : α) => β} {a : α} {f : ββ} (htb : t.Balanced) (hto : t.Ordered) :
(modify a f t).Ordered

mergeWith #

theorem Std.DTreeMap.Internal.Impl.Const.ordered_mergeWith {α : Type u} {β : Type v} [Ord α] [TransOrd α] {t₁ t₂ : Impl α fun (x : α) => β} {f : αβββ} (htb : t₁.Balanced) (hto : t₁.Ordered) :
(mergeWith f t₁ t₂ htb).impl.Ordered

toList #

theorem Std.DTreeMap.Internal.Impl.Const.toList_eq_toListModel_map {α : Type u} {β : Type v} {t : Impl α fun (x : α) => β} :
toList t = List.map (fun (x : (_ : α) × β) => match x with | k, v => (k, v)) t.toListModel

Deducing that well-formed trees are ordered #

theorem Std.DTreeMap.Internal.Impl.WF.ordered {α : Type u} {β : αType v} [Ord α] [TransOrd α] {l : Impl α β} (h : l.WF) :

Deducing that additional operations are well-formed #

inductive Std.DTreeMap.Internal.Impl.SameKeys {α : Type u} {β : αType v} {β' : αType u_1} :
Impl α βImpl α β'Prop

Internal implementation detail of the tree map

Instances For
    theorem Std.DTreeMap.Internal.Impl.SameKeys.ordered_iff_pairwise_keys {α : Type u} {β : αType v} [Ord α] {t : Impl α β} :
    t.Ordered List.Pairwise (fun (x1 x2 : α) => compare x1 x2 = Ordering.lt) (List.map (fun (x : (a : α) × β a) => x.fst) t.toListModel)
    theorem Std.DTreeMap.Internal.Impl.SameKeys.symm {α : Type u} {β : αType v} {β' : αType u_1} [Ord α] {t : Impl α β} {t' : Impl α β'} (hs : t.SameKeys t') :
    theorem Std.DTreeMap.Internal.Impl.SameKeys.keys_eq {α : Type u} {β : αType v} {β' : αType u_1} [Ord α] {t : Impl α β} {t' : Impl α β'} (h : t.SameKeys t') :
    List.map (fun (x : (a : α) × β a) => x.fst) t.toListModel = List.map (fun (x : (a : α) × β' a) => x.fst) t'.toListModel
    theorem Std.DTreeMap.Internal.Impl.SameKeys.size_eq {α : Type u} {β : αType v} {β' : αType u_1} [Ord α] {t : Impl α β} {t' : Impl α β'} (h : t.SameKeys t') :
    t.size = t'.size
    theorem Std.DTreeMap.Internal.Impl.SameKeys.ordered {α : Type u} {β : αType v} {β' : αType u_1} [Ord α] {t : Impl α β} {t' : Impl α β'} (hs : t.SameKeys t') (h : t.Ordered) :
    theorem Std.DTreeMap.Internal.Impl.SameKeys.balanced {α : Type u} {β : αType v} {β' : αType u_1} [Ord α] {t : Impl α β} {t' : Impl α β'} (hs : t.SameKeys t') (h : t.Balanced) :
    theorem Std.DTreeMap.Internal.Impl.SameKeys.wf {α : Type u} {β : αType v} {β' : αType u_1} [Ord α] {t : Impl α β} {t' : Impl α β'} (hs : t.SameKeys t') (h : t.WF) :
    t'.WF

    getThenInsertIfNew?! #

    theorem Std.DTreeMap.Internal.Impl.WF.getThenInsertIfNew?! {α : Type u} {β : αType v} {x✝ : Ord α} [TransOrd α] [LawfulEqOrd α] {k : α} {v : β k} {t : Impl α β} (h : t.WF) :
    theorem Std.DTreeMap.Internal.Impl.WF.constGetThenInsertIfNew?! {α : Type u} {β : Type v} {x✝ : Ord α} [TransOrd α] {k : α} {v : β} {t : Impl α fun (x : α) => β} (h : t.WF) :

    eraseMany! #

    theorem Std.DTreeMap.Internal.Impl.WF.eraseMany! {α : Type u} {β : αType v} {x✝ : Ord α} [TransOrd α] {ρ : Type u_1} [ForIn Id ρ α] {l : ρ} {t : Impl α β} (h : t.WF) :

    insertMany! #

    theorem Std.DTreeMap.Internal.Impl.WF.insertMany! {α : Type u} {β : αType v} {x✝ : Ord α} [TransOrd α] {ρ : Type u_1} [ForIn Id ρ ((a : α) × β a)] {l : ρ} {t : Impl α β} (h : t.WF) :
    theorem Std.DTreeMap.Internal.Impl.WF.constInsertMany! {α : Type u} {β : Type v} {x✝ : Ord α} [TransOrd α] {ρ : Type u_1} [ForIn Id ρ (α × β)] {l : ρ} {t : Impl α fun (x : α) => β} (h : t.WF) :
    theorem Std.DTreeMap.Internal.Impl.WF.constInsertManyIfNewUnit! {α : Type u} {x✝ : Ord α} [TransOrd α] {ρ : Type u_1} [ForIn Id ρ α] {l : ρ} {t : Impl α fun (x : α) => Unit} (h : t.WF) :

    alter! #

    theorem Std.DTreeMap.Internal.Impl.WF.alter! {α : Type u} {β : αType v} {x✝ : Ord α} [LawfulEqOrd α] {t : Impl α β} {a : α} {f : Option (β a)Option (β a)} (h : t.WF) :
    (Impl.alter! a f t).WF
    theorem Std.DTreeMap.Internal.Impl.WF.constAlter! {α : Type u} {x✝ : Ord α} {β : Type v} {t : Impl α fun (x : α) => β} {a : α} {f : Option βOption β} (h : t.WF) :

    mergeWith! #

    theorem Std.DTreeMap.Internal.Impl.mergeWith_eq_mergeWith! {α : Type u} {β : αType v} {x✝ : Ord α} [LawfulEqOrd α] {mergeFn : (a : α) → β aβ aβ a} {t₁ t₂ : Impl α β} (h : t₁.Balanced) :
    (mergeWith mergeFn t₁ t₂ h).impl = mergeWith! mergeFn t₁ t₂
    theorem Std.DTreeMap.Internal.Impl.WF.mergeWith! {α : Type u} {β : αType v} {x✝ : Ord α} [LawfulEqOrd α] {mergeFn : (a : α) → β aβ aβ a} {t₁ t₂ : Impl α β} (h : t₁.WF) :
    (Impl.mergeWith! mergeFn t₁ t₂).WF
    theorem Std.DTreeMap.Internal.Impl.Const.mergeWith_eq_mergeWith! {α : Type u} {β : Type v} {x✝ : Ord α} {mergeFn : αβββ} {t₁ t₂ : Impl α fun (x : α) => β} (h : t₁.Balanced) :
    (mergeWith mergeFn t₁ t₂ h).impl = mergeWith! mergeFn t₁ t₂
    theorem Std.DTreeMap.Internal.Impl.WF.constMergeWith! {α : Type u} {β : Type v} {x✝ : Ord α} {mergeFn : αβββ} {t₁ t₂ : Impl α fun (x : α) => β} (h : t₁.WF) :
    (Const.mergeWith! mergeFn t₁ t₂).WF

    filterMap #

    theorem Std.DTreeMap.Internal.Impl.WF.filterMap {α : Type u} {β : αType v} {γ : αType w} [Ord α] {t : Impl α β} {h : t.Balanced} {f : (a : α) → β aOption (γ a)} (hwf : t.WF) :

    filterMap! #

    theorem Std.DTreeMap.Internal.Impl.filterMap_eq_filterMap! {α : Type u} {β : αType v} {γ : αType w} [Ord α] {t : Impl α β} {h : t.Balanced} {f : (a : α) → β aOption (γ a)} :
    theorem Std.DTreeMap.Internal.Impl.WF.filterMap! {α : Type u} {β : αType v} {γ : αType w} {x✝ : Ord α} {t : Impl α β} {f : (a : α) → β aOption (γ a)} (h : t.WF) :

    filter! #

    theorem Std.DTreeMap.Internal.Impl.filter_eq_filter! {α : Type u} {β : αType v} [Ord α] {t : Impl α β} {h : t.Balanced} {f : (a : α) → β aBool} :
    (filter f t h).impl = filter! f t
    theorem Std.DTreeMap.Internal.Impl.WF.filter! {α : Type u} {β : αType v} {x✝ : Ord α} {t : Impl α β} {f : (a : α) → β aBool} (h : t.WF) :

    map #

    theorem Std.DTreeMap.Internal.Impl.toListModel_map {α : Type u} {β : αType v} {γ : αType w} [Ord α] {t : Impl α β} {f : (a : α) → β aγ a} :
    (map f t).toListModel = List.map (fun (x : (a : α) × β a) => x.fst, f x.fst x.snd) t.toListModel
    theorem Std.DTreeMap.Internal.Impl.sameKeys_map {α : Type u} {β : αType v} {γ : αType w} [Ord α] {t : Impl α β} {f : (a : α) → β aγ a} :
    (map f t).SameKeys t
    @[simp]
    theorem Std.DTreeMap.Internal.Impl.size_map {α : Type u} {β : αType v} {γ : αType w} [Ord α] {t : Impl α β} {f : (a : α) → β aγ a} :
    (map f t).size = t.size
    theorem Std.DTreeMap.Internal.Impl.WF.map {α : Type u} {β : αType v} {γ : αType w} [Ord α] {t : Impl α β} {f : (a : α) → β aγ a} (h : t.WF) :
    (Impl.map f t).WF