Documentation

BatteriesRecycling.RBTree.Lemmas

Additional lemmas for Red-black trees #

@[simp]
theorem RBTree.RBNode.min?_reverse {α : Type u_1} (t : RBNode α) :
@[simp]
theorem RBTree.RBNode.max?_reverse {α : Type u_1} (t : RBNode α) :
@[simp]
theorem RBTree.RBNode.mem_nil {α : Type u_1} {x : α} :
@[simp]
theorem RBTree.RBNode.mem_node {α : Type u_1} {y : α} {c : RBColor} {a : RBNode α} {x : α} {b : RBNode α} :
y node c a x b y = x y a y b
theorem RBTree.RBNode.All_def {α : Type u_1} {p : αProp} {t : RBNode α} :
All p t ∀ (x : α), x tp x
theorem RBTree.RBNode.Any_def {α : Type u_1} {p : αProp} {t : RBNode α} :
Any p t (x : α), x t p x
theorem RBTree.RBNode.memP_def {α✝ : Type u_1} {cut : α✝Ordering} {t : RBNode α✝} :
MemP cut t (x : α✝), x t cut x = Ordering.eq
theorem RBTree.RBNode.mem_def {α✝ : Type u_1} {cmp : α✝α✝Ordering} {x : α✝} {t : RBNode α✝} :
Mem cmp x t (y : α✝), y t cmp x y = Ordering.eq
theorem RBTree.RBNode.mem_congr {α : Type u_1} {cmp : ααOrdering} {x y : α} [Std.TransCmp cmp] {t : RBNode α} (h : cmp x y = Ordering.eq) :
Mem cmp x t Mem cmp y t
theorem RBTree.RBNode.isOrdered_iff' {α : Type u_1} {cmp : ααOrdering} {L R : Option α} [Std.TransCmp cmp] {t : RBNode α} :
isOrdered cmp t L R = true (∀ (a : α), a LAll (fun (x : α) => cmpLT cmp a x) t) (∀ (a : α), a RAll (fun (x : α) => cmpLT cmp x a) t) (∀ (a : α), a L∀ (b : α), b RcmpLT cmp a b) Ordered cmp t
theorem RBTree.RBNode.isOrdered_iff {α : Type u_1} {cmp : ααOrdering} [Std.TransCmp cmp] {t : RBNode α} :
isOrdered cmp t = true Ordered cmp t
@[implicit_reducible]
instance RBTree.RBNode.instDecidableOrderedOfTransCmp {α : Type u_1} (cmp : ααOrdering) [Std.TransCmp cmp] (t : RBNode α) :
Equations
class RBTree.RBNode.IsCut {α : Type u_1} (cmp : ααOrdering) (cut : αOrdering) :

A cut is like a homomorphism of orderings: it is a monotonic predicate with respect to cmp, but it can make things that are distinguished by cmp equal. This is sufficient for find? to locate an element on which cut returns .eq, but there may be other elements, not returned by find?, on which cut also returns .eq.

Instances
    theorem RBTree.RBNode.IsCut.lt_trans {α✝ : Type u_1} {cmp : α✝α✝Ordering} {cut : α✝Ordering} {x y : α✝} [IsCut cmp cut] [Std.TransCmp cmp] (H : cmp x y = Ordering.lt) :
    cut x = Ordering.ltcut y = Ordering.lt
    theorem RBTree.RBNode.IsCut.gt_trans {α✝ : Type u_1} {cmp : α✝α✝Ordering} {cut : α✝Ordering} {x y : α✝} [IsCut cmp cut] [Std.TransCmp cmp] (H : cmp x y = Ordering.lt) :
    cut y = Ordering.gtcut x = Ordering.gt
    theorem RBTree.RBNode.IsCut.congr {α✝ : Type u_1} {cmp : α✝α✝Ordering} {cut : α✝Ordering} {x y : α✝} [IsCut cmp cut] [Std.TransCmp cmp] (H : cmp x y = Ordering.eq) :
    cut x = cut y
    instance RBTree.RBNode.instIsCutFlipOrderingSwap {α : Type u_1} (cmp : ααOrdering) (cut : αOrdering) [IsCut cmp cut] :
    IsCut (flip cmp) fun (x : α) => (cut x).swap
    class RBTree.RBNode.IsStrictCut {α : Type u_1} (cmp : ααOrdering) (cut : αOrdering) extends RBTree.RBNode.IsCut cmp cut :

    IsStrictCut upgrades the IsCut property to ensure that at most one element of the tree can match the cut, and hence find? will return the unique such element if one exists.

    Instances
      instance RBTree.RBNode.instIsStrictCut {α : Type u_1} (cmp : ααOrdering) (a : α) :
      IsStrictCut cmp (cmp a)

      A "representable cut" is one generated by cmp a for some a. This is always a valid cut.

      instance RBTree.RBNode.instIsStrictCutFlipOrderingSwap {α : Type u_1} (cmp : ααOrdering) (cut : αOrdering) [IsStrictCut cmp cut] :
      IsStrictCut (flip cmp) fun (x : α) => (cut x).swap
      theorem RBTree.RBNode.foldr_cons {α : Type u_1} (t : RBNode α) (l : List α) :
      foldr (fun (x1 : α) (x2 : List α) => x1 :: x2) t l = t.toList ++ l
      @[simp]
      @[simp]
      theorem RBTree.RBNode.toList_node {α : Type u_1} {c : RBColor} {a : RBNode α} {x : α} {b : RBNode α} :
      (node c a x b).toList = a.toList ++ x :: b.toList
      @[simp]
      @[simp]
      theorem RBTree.RBNode.mem_toList {α : Type u_1} {x : α} {t : RBNode α} :
      x t.toList x t
      @[simp]
      theorem RBTree.RBNode.mem_reverse {α : Type u_1} {a : α} {t : RBNode α} :
      a t.reverse a t
      theorem RBTree.RBNode.foldr_eq_foldr_toList {α : Type u_1} {α✝ : Type u_2} {f : αα✝α✝} {init : α✝} {t : RBNode α} :
      foldr f t init = List.foldr f init t.toList
      theorem RBTree.RBNode.foldl_eq_foldl_toList {α : Type u_1} {α✝ : Type u_2} {f : α✝αα✝} {init : α✝} {t : RBNode α} :
      foldl f init t = List.foldl f init t.toList
      theorem RBTree.RBNode.foldl_reverse {α : Type u_1} {β : Type u_2} {t : RBNode α} {f : βαβ} {init : β} :
      foldl f init t.reverse = foldr (flip f) t init
      theorem RBTree.RBNode.foldr_reverse {α : Type u_1} {β : Type u_2} {t : RBNode α} {f : αββ} {init : β} :
      foldr f t.reverse init = foldl (flip f) init t
      theorem RBTree.RBNode.forM_eq_forM_toList {m : Type u_1 → Type u_2} {α : Type u_3} {f : αm PUnit} [Monad m] [LawfulMonad m] {t : RBNode α} :
      forM f t = t.toList.forM f
      theorem RBTree.RBNode.foldlM_eq_foldlM_toList {m : Type u_1 → Type u_2} {α : Type u_3} {a✝ : Type u_1} {f : a✝αm a✝} {init : a✝} [Monad m] [LawfulMonad m] {t : RBNode α} :
      foldlM f init t = List.foldlM f init t.toList
      theorem RBTree.RBNode.forIn_visit_eq_bindList {m : Type u_1 → Type u_2} {α : Type u_3} {α✝ : Type u_1} {f : αα✝m (ForInStep α✝)} {init : α✝} [Monad m] [LawfulMonad m] {t : RBNode α} :
      theorem RBTree.RBNode.forIn_eq_forIn_toList {m : Type u_1 → Type u_2} {α : Type u_3} {α✝ : Type u_1} {init : α✝} {f : αα✝m (ForInStep α✝)} [Monad m] [LawfulMonad m] {t : RBNode α} :
      forIn t init f = forIn t.toList init f
      theorem RBTree.RBNode.Stream.foldr_cons {α : Type u_1} (t : RBNode.Stream α) (l : List α) :
      foldr (fun (x1 : α) (x2 : List α) => x1 :: x2) t l = t.toList ++ l
      @[simp]
      theorem RBTree.RBNode.Stream.toList_cons {α : Type u_1} {x : α} {r : RBNode α} {s : RBNode.Stream α} :
      (cons x r s).toList = x :: r.toList ++ s.toList
      theorem RBTree.RBNode.Stream.foldr_eq_foldr_toList {α : Type u_1} {α✝ : Type u_2} {f : αα✝α✝} {init : α✝} {s : RBNode.Stream α} :
      foldr f s init = List.foldr f init s.toList
      theorem RBTree.RBNode.Stream.foldl_eq_foldl_toList {α : Type u_1} {α✝ : Type u_2} {f : α✝αα✝} {init : α✝} {t : RBNode.Stream α} :
      foldl f init t = List.foldl f init t.toList
      theorem RBTree.RBNode.Stream.forIn_eq_forIn_toList {m : Type u_1 → Type u_2} {α : Type u_3} {α✝ : Type u_1} {init : α✝} {f : αα✝m (ForInStep α✝)} [Monad m] [LawfulMonad m] {t : RBNode α} :
      forIn t init f = forIn t.toList init f
      @[simp]
      theorem RBTree.RBNode.Stream.next?_toList {α : Type u_1} {s : RBNode.Stream α} :
      Option.map (fun (x : α × RBNode.Stream α) => match x with | (a, b) => (a, b.toList)) s.next? = s.toList.next?
      theorem RBTree.RBNode.ordered_iff {α : Type u_1} {cmp : ααOrdering} {t : RBNode α} :
      theorem RBTree.RBNode.Ordered.toList_sorted {α : Type u_1} {cmp : ααOrdering} {t : RBNode α} :
      Ordered cmp tList.Pairwise (cmpLT cmp) t.toList
      theorem RBTree.RBNode.min?_mem {α : Type u_1} {a : α} {t : RBNode α} (h : t.min? = some a) :
      a t
      theorem RBTree.RBNode.Ordered.min?_le {α : Type u_1} {cmp : ααOrdering} {a : α} {t : RBNode α} [Std.TransCmp cmp] (ht : Ordered cmp t) (h : t.min? = some a) (x : α) (hx : x t) :
      theorem RBTree.RBNode.max?_mem {α : Type u_1} {a : α} {t : RBNode α} (h : t.max? = some a) :
      a t
      theorem RBTree.RBNode.Ordered.le_max? {α : Type u_1} {cmp : ααOrdering} {a : α} {t : RBNode α} [Std.TransCmp cmp] (ht : Ordered cmp t) (h : t.max? = some a) (x : α) (hx : x t) :
      @[simp]
      @[simp]
      theorem RBTree.RBNode.setRed_toList {α : Type u_1} {t : RBNode α} :
      @[simp]
      theorem RBTree.RBNode.balance1_toList {α : Type u_1} {l : RBNode α} {v : α} {r : RBNode α} :
      @[simp]
      theorem RBTree.RBNode.balance2_toList {α : Type u_1} {l : RBNode α} {v : α} {r : RBNode α} :
      @[simp]
      theorem RBTree.RBNode.balLeft_toList {α : Type u_1} {l : RBNode α} {v : α} {r : RBNode α} :
      (l.balLeft v r).toList = l.toList ++ v :: r.toList
      @[simp]
      theorem RBTree.RBNode.balRight_toList {α : Type u_1} {l : RBNode α} {v : α} {r : RBNode α} :
      theorem RBTree.RBNode.size_eq {α : Type u_1} {t : RBNode α} :
      @[simp]
      theorem RBTree.RBNode.reverse_size {α : Type u_1} (t : RBNode α) :
      @[simp]
      theorem RBTree.RBNode.Any_reverse {α : Type u_1} {p : αProp} {t : RBNode α} :
      Any p t.reverse Any p t
      @[simp]
      theorem RBTree.RBNode.memP_reverse {α : Type u_1} {cut : αOrdering} {t : RBNode α} :
      MemP cut t.reverse MemP (fun (x : α) => (cut x).swap) t
      theorem RBTree.RBNode.Mem_reverse {α : Type u_1} {cmp : ααOrdering} {x : α} [Std.OrientedCmp cmp] {t : RBNode α} :
      Mem cmp x t.reverse Mem (flip cmp) x t
      theorem RBTree.RBNode.find?_some_eq_eq {α : Type u_1} {cut : αOrdering} {x : α} {t : RBNode α} :
      x find? cut tcut x = Ordering.eq
      theorem RBTree.RBNode.find?_some_mem {α : Type u_1} {cut : αOrdering} {x : α} {t : RBNode α} :
      x find? cut tx t
      theorem RBTree.RBNode.find?_some_memP {α : Type u_1} {cut : αOrdering} {x : α} {t : RBNode α} (h : x find? cut t) :
      MemP cut t
      theorem RBTree.RBNode.Ordered.memP_iff_find? {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} [Std.TransCmp cmp] [IsCut cmp cut] (ht : Ordered cmp t) :
      MemP cut t (x : α), find? cut t = some x
      theorem RBTree.RBNode.Ordered.unique {α : Type u_1} {cmp : ααOrdering} {t : RBNode α} {x y : α} [Std.TransCmp cmp] (ht : Ordered cmp t) (hx : x t) (hy : y t) (e : cmp x y = Ordering.eq) :
      x = y
      theorem RBTree.RBNode.Ordered.find?_some {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} {x : α} [Std.TransCmp cmp] [IsStrictCut cmp cut] (ht : Ordered cmp t) :
      find? cut t = some x x t cut x = Ordering.eq
      @[simp]
      theorem RBTree.RBNode.find?_reverse {α : Type u_1} (t : RBNode α) (cut : αOrdering) :
      find? cut t.reverse = find? (fun (x : α) => (cut x).swap) t
      def RBTree.RBNode.setRoot {α : Type u_1} (v : α) :
      RBNode αRBNode α

      Auxiliary definition for zoom_ins: set the root of the tree to v, creating a node if necessary.

      Equations
      Instances For
        def RBTree.RBNode.delRoot {α : Type u_1} :
        RBNode αRBNode α

        Auxiliary definition for zoom_ins: set the root of the tree to v, creating a node if necessary.

        Equations
        Instances For
          @[simp]
          theorem RBTree.RBNode.upperBound?_reverse {α : Type u_1} (t : RBNode α) (cut : αOrdering) (ub : Option α) :
          upperBound? cut t.reverse ub = lowerBound? (fun (x : α) => (cut x).swap) t ub
          @[simp]
          theorem RBTree.RBNode.lowerBound?_reverse {α : Type u_1} (t : RBNode α) (cut : αOrdering) (lb : Option α) :
          lowerBound? cut t.reverse lb = upperBound? (fun (x : α) => (cut x).swap) t lb
          theorem RBTree.RBNode.upperBound?_eq_find? {α : Type u_1} {x : α} {t : RBNode α} {cut : αOrdering} (ub : Option α) (H : find? cut t = some x) :
          upperBound? cut t ub = some x
          theorem RBTree.RBNode.lowerBound?_eq_find? {α : Type u_1} {x : α} {t : RBNode α} {cut : αOrdering} (lb : Option α) (H : find? cut t = some x) :
          lowerBound? cut t lb = some x
          theorem RBTree.RBNode.upperBound?_ge' {α : Type u_1} {ub : Option α} {cut : αOrdering} {x : α} {t : RBNode α} (H : ∀ {x : α}, x ubcut x Ordering.gt) :
          upperBound? cut t ub = some xcut x Ordering.gt

          The value x returned by upperBound? is greater or equal to the cut.

          theorem RBTree.RBNode.upperBound?_ge {α : Type u_1} {cut : αOrdering} {x : α} {t : RBNode α} :
          upperBound? cut t = some xcut x Ordering.gt

          The value x returned by upperBound? is greater or equal to the cut.

          theorem RBTree.RBNode.lowerBound?_le' {α : Type u_1} {lb : Option α} {cut : αOrdering} {x : α} {t : RBNode α} (H : ∀ {x : α}, x lbcut x Ordering.lt) :
          lowerBound? cut t lb = some xcut x Ordering.lt

          The value x returned by lowerBound? is less or equal to the cut.

          theorem RBTree.RBNode.lowerBound?_le {α : Type u_1} {cut : αOrdering} {x : α} {t : RBNode α} :
          lowerBound? cut t = some xcut x Ordering.lt

          The value x returned by lowerBound? is less or equal to the cut.

          theorem RBTree.RBNode.All.upperBound?_ub {α : Type u_1} {p : αProp} {ub : Option α} {cut : αOrdering} {x : α} {t : RBNode α} (hp : All p t) (H : ∀ {x : α}, ub = some xp x) :
          RBNode.upperBound? cut t ub = some xp x
          theorem RBTree.RBNode.All.upperBound? {α : Type u_1} {p : αProp} {cut : αOrdering} {x : α} {t : RBNode α} (hp : All p t) :
          RBNode.upperBound? cut t = some xp x
          theorem RBTree.RBNode.All.lowerBound?_lb {α : Type u_1} {p : αProp} {lb : Option α} {cut : αOrdering} {x : α} {t : RBNode α} (hp : All p t) (H : ∀ {x : α}, lb = some xp x) :
          RBNode.lowerBound? cut t lb = some xp x
          theorem RBTree.RBNode.All.lowerBound? {α : Type u_1} {p : αProp} {cut : αOrdering} {x : α} {t : RBNode α} (hp : All p t) :
          RBNode.lowerBound? cut t = some xp x
          theorem RBTree.RBNode.upperBound?_mem_ub {α : Type u_1} {cut : αOrdering} {ub : Option α} {x : α} {t : RBNode α} (h : upperBound? cut t ub = some x) :
          x t ub = some x
          theorem RBTree.RBNode.upperBound?_mem {α : Type u_1} {cut : αOrdering} {x : α} {t : RBNode α} (h : upperBound? cut t = some x) :
          x t
          theorem RBTree.RBNode.lowerBound?_mem_lb {α : Type u_1} {cut : αOrdering} {lb : Option α} {x : α} {t : RBNode α} (h : lowerBound? cut t lb = some x) :
          x t lb = some x
          theorem RBTree.RBNode.lowerBound?_mem {α : Type u_1} {cut : αOrdering} {x : α} {t : RBNode α} (h : lowerBound? cut t = some x) :
          x t
          theorem RBTree.RBNode.upperBound?_of_some {α : Type u_1} {cut : αOrdering} {y : α} {t : RBNode α} :
          (x : α), upperBound? cut t (some y) = some x
          theorem RBTree.RBNode.lowerBound?_of_some {α : Type u_1} {cut : αOrdering} {y : α} {t : RBNode α} :
          (x : α), lowerBound? cut t (some y) = some x
          theorem RBTree.RBNode.Ordered.upperBound?_exists {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} [Std.TransCmp cmp] [IsCut cmp cut] (h : Ordered cmp t) :
          ( (x : α), upperBound? cut t = some x) (x : α), x t cut x Ordering.gt
          theorem RBTree.RBNode.Ordered.lowerBound?_exists {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} [Std.TransCmp cmp] [IsCut cmp cut] (h : Ordered cmp t) :
          ( (x : α), lowerBound? cut t = some x) (x : α), x t cut x Ordering.lt
          theorem RBTree.RBNode.Ordered.upperBound?_least_ub {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} {ub : Option α} {x y : α} [Std.TransCmp cmp] [IsCut cmp cut] (h : Ordered cmp t) (hub : ∀ {x : α}, ub = some xAll (fun (x_1 : α) => cmpLT cmp x_1 x) t) :
          upperBound? cut t ub = some xy tcut x = Ordering.ltcmp y x = Ordering.ltcut y = Ordering.gt
          theorem RBTree.RBNode.Ordered.lowerBound?_greatest_lb {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} {lb : Option α} {x y : α} [Std.TransCmp cmp] [IsCut cmp cut] (h : Ordered cmp t) (hlb : ∀ {x : α}, lb = some xAll (fun (x_1 : α) => cmpLT cmp x x_1) t) :
          lowerBound? cut t lb = some xy tcut x = Ordering.gtcmp x y = Ordering.ltcut y = Ordering.lt
          theorem RBTree.RBNode.Ordered.upperBound?_least {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} {x y : α} [Std.TransCmp cmp] [IsCut cmp cut] (ht : Ordered cmp t) (H : upperBound? cut t = some x) (hy : y t) (xy : cmp y x = Ordering.lt) (hx : cut x = Ordering.lt) :

          A statement of the least-ness of the result of upperBound?. If x is the return value of upperBound? and it is strictly greater than the cut, then any other y < x in the tree is in fact strictly less than the cut (so there is no exact match, and nothing closer to the cut).

          theorem RBTree.RBNode.Ordered.lowerBound?_greatest {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} {x y : α} [Std.TransCmp cmp] [IsCut cmp cut] (ht : Ordered cmp t) (H : lowerBound? cut t = some x) (hy : y t) (xy : cmp x y = Ordering.lt) (hx : cut x = Ordering.gt) :

          A statement of the greatest-ness of the result of lowerBound?. If x is the return value of lowerBound? and it is strictly less than the cut, then any other y > x in the tree is in fact strictly greater than the cut (so there is no exact match, and nothing closer to the cut).

          theorem RBTree.RBNode.Ordered.memP_iff_upperBound? {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} [Std.TransCmp cmp] [IsCut cmp cut] (ht : Ordered cmp t) :
          MemP cut t (x : α), upperBound? cut t = some x cut x = Ordering.eq
          theorem RBTree.RBNode.Ordered.memP_iff_lowerBound? {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} [Std.TransCmp cmp] [IsCut cmp cut] (ht : Ordered cmp t) :
          MemP cut t (x : α), lowerBound? cut t = some x cut x = Ordering.eq
          theorem RBTree.RBNode.Ordered.lowerBound?_lt {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} {x y : α} [Std.TransCmp cmp] [IsStrictCut cmp cut] (ht : Ordered cmp t) (H : lowerBound? cut t = some x) (hy : y t) :
          cmp x y = Ordering.lt cut y = Ordering.lt

          A stronger version of lowerBound?_greatest that holds when the cut is strict.

          theorem RBTree.RBNode.Ordered.lt_upperBound? {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBNode α} {x y : α} [Std.TransCmp cmp] [IsStrictCut cmp cut] (ht : Ordered cmp t) (H : upperBound? cut t = some x) (hy : y t) :
          cmp y x = Ordering.lt cut y = Ordering.gt

          A stronger version of upperBound?_least that holds when the cut is strict.

          def RBTree.RBNode.Path.listL {α : Type u_1} :
          Path αList α

          The list of elements to the left of the hole. (This function is intended for specification purposes only.)

          Equations
          Instances For
            def RBTree.RBNode.Path.listR {α : Type u_1} :
            Path αList α

            The list of elements to the right of the hole. (This function is intended for specification purposes only.)

            Equations
            Instances For
              @[reducible, inline]
              abbrev RBTree.RBNode.Path.withList {α : Type u_1} (p : Path α) (l : List α) :
              List α

              Wraps a list of elements with the left and right elements of the path.

              Equations
              Instances For
                theorem RBTree.RBNode.Path.rootOrdered_iff {α : Type u_1} {cmp : ααOrdering} {v : α} {p : Path α} (hp : Ordered cmp p) :
                RootOrdered cmp p v (∀ (a : α), a p.listLcmpLT cmp a v) ∀ (a : α), a p.listRcmpLT cmp v a
                theorem RBTree.RBNode.Path.ordered_iff {α : Type u_1} {cmp : ααOrdering} {p : Path α} :
                Ordered cmp p List.Pairwise (cmpLT cmp) p.listL List.Pairwise (cmpLT cmp) p.listR ∀ (x : α), x p.listL∀ (y : α), y p.listRcmpLT cmp x y
                theorem RBTree.RBNode.Path.zoom_zoomed₁ {α✝ : Type u_1} {cut : α✝Ordering} {t : RBNode α✝} {path : Path α✝} {t' : RBNode α✝} {path' : Path α✝} (e : zoom cut t path = (t', path')) :
                OnRoot (fun (x : α✝) => cut x = Ordering.eq) t'
                @[simp]
                theorem RBTree.RBNode.Path.fill_toList {α : Type u_1} {t : RBNode α} {p : Path α} :
                theorem RBTree.RBNode.zoom_toList {α : Type u_1} {cut : αOrdering} {t' : RBNode α} {p' : Path α} {t : RBNode α} (eq : zoom cut t = (t', p')) :
                @[simp]
                theorem RBTree.RBNode.Path.ins_toList {α : Type u_1} {t : RBNode α} {p : Path α} :
                @[simp]
                theorem RBTree.RBNode.Path.insertNew_toList {α : Type u_1} {v : α} {p : Path α} :
                theorem RBTree.RBNode.Path.insert_toList {α : Type u_1} {t : RBNode α} {v : α} {p : Path α} :
                theorem RBTree.RBNode.Path.Balanced.insert {α : Type u_1} {c₀ : RBColor} {n₀ : Nat} {c : RBColor} {n : Nat} {t : RBNode α} {v : α} {path : Path α} (hp : Path.Balanced c₀ n₀ path c n) :
                t.Balanced c n (c : RBColor), (n : Nat), (path.insert t v).Balanced c n
                theorem RBTree.RBNode.Path.Ordered.insert {α : Type u_1} {cmp : ααOrdering} {v : α} {path : Path α} {t : RBNode α} :
                Ordered cmp pathRBNode.Ordered cmp tAll (RootOrdered cmp path) tRootOrdered cmp path vOnRoot (cmpEq cmp v) tRBNode.Ordered cmp (path.insert t v)
                theorem RBTree.RBNode.Path.Ordered.erase {α : Type u_1} {cmp : ααOrdering} {path : Path α} {t : RBNode α} :
                Ordered cmp pathRBNode.Ordered cmp tAll (RootOrdered cmp path) tRBNode.Ordered cmp (path.erase t)
                theorem RBTree.RBNode.Path.zoom_ins {α : Type u_1} {v : α} {path : Path α} {t' : RBNode α} {path' : Path α} {t : RBNode α} {cmp : ααOrdering} :
                zoom (cmp v) t path = (t', path')path.ins (RBNode.ins cmp v t) = path'.ins (setRoot v t')
                theorem RBTree.RBNode.Path.insertNew_eq_insert {α✝ : Type u_1} {cmp : α✝α✝Ordering} {t : RBNode α✝} {path : Path α✝} {v : α✝} (h : zoom (cmp v) t = (nil, path)) :
                theorem RBTree.RBNode.Path.ins_eq_fill {α : Type u_1} {c₀ : RBColor} {n₀ : Nat} {c : RBColor} {n : Nat} {path : Path α} {t : RBNode α} :
                Path.Balanced c₀ n₀ path c nt.Balanced c npath.ins t = (path.fill t).setBlack
                theorem RBTree.RBNode.Path.zoom_insert {α : Type u_1} {c : RBColor} {n : Nat} {cmp : ααOrdering} {t' : RBNode α} {v : α} {path : Path α} {t : RBNode α} (ht : t.Balanced c n) (H : zoom (cmp v) t = (t', path)) :
                (path.insert t' v).setBlack = (RBNode.insert cmp t v).setBlack
                theorem RBTree.RBNode.Path.zoom_del {α : Type u_1} {cut : αOrdering} {path : Path α} {t' : RBNode α} {path' : Path α} {t : RBNode α} :
                zoom cut t path = (t', path')path.del (RBNode.del cut t) (match t with | node c l v r => c | x => RBColor.red) = path'.del t'.delRoot (match t' with | node c l v r => c | x => RBColor.red)
                def RBTree.RBNode.Path.AllL {α : Type u_1} (p : αProp) :
                Path αProp

                Asserts that p holds on all elements to the left of the hole.

                Equations
                Instances For
                  def RBTree.RBNode.Path.AllR {α : Type u_1} (p : αProp) :
                  Path αProp

                  Asserts that p holds on all elements to the right of the hole.

                  Equations
                  Instances For
                    theorem RBTree.RBNode.insert_toList_zoom {α : Type u_1} {c : RBColor} {n : Nat} {cmp : ααOrdering} {t' : RBNode α} {p : Path α} {v : α} {t : RBNode α} (ht : t.Balanced c n) (e : zoom (cmp v) t = (t', p)) :
                    (insert cmp t v).toList = p.withList (setRoot v t').toList
                    theorem RBTree.RBNode.insert_toList_zoom_nil {α : Type u_1} {c : RBColor} {n : Nat} {cmp : ααOrdering} {p : Path α} {v : α} {t : RBNode α} (ht : t.Balanced c n) (e : zoom (cmp v) t = (nil, p)) :
                    (insert cmp t v).toList = p.withList [v]
                    theorem RBTree.RBNode.exists_insert_toList_zoom_nil {α : Type u_1} {c : RBColor} {n : Nat} {cmp : ααOrdering} {p : Path α} {v : α} {t : RBNode α} (ht : t.Balanced c n) (e : zoom (cmp v) t = (nil, p)) :
                    (L : List α), (R : List α), t.toList = L ++ R (insert cmp t v).toList = L ++ v :: R
                    theorem RBTree.RBNode.insert_toList_zoom_node {α : Type u_1} {c : RBColor} {n : Nat} {cmp : ααOrdering} {c' : RBColor} {l : RBNode α} {v' : α} {r : RBNode α} {p : Path α} {v : α} {t : RBNode α} (ht : t.Balanced c n) (e : zoom (cmp v) t = (node c' l v' r, p)) :
                    (insert cmp t v).toList = p.withList (node c l v r).toList
                    theorem RBTree.RBNode.exists_insert_toList_zoom_node {α : Type u_1} {c : RBColor} {n : Nat} {cmp : ααOrdering} {c' : RBColor} {l : RBNode α} {v' : α} {r : RBNode α} {p : Path α} {v : α} {t : RBNode α} (ht : t.Balanced c n) (e : zoom (cmp v) t = (node c' l v' r, p)) :
                    (L : List α), (R : List α), t.toList = L ++ v' :: R (insert cmp t v).toList = L ++ v :: R
                    theorem RBTree.RBNode.mem_insert_self {α : Type u_1} {c : RBColor} {n : Nat} {cmp : ααOrdering} {v : α} {t : RBNode α} (ht : t.Balanced c n) :
                    v insert cmp t v
                    theorem RBTree.RBNode.mem_insert_of_mem {α : Type u_1} {c : RBColor} {n : Nat} {v' : α} {cmp : ααOrdering} {v : α} {t : RBNode α} (ht : t.Balanced c n) (h : v' t) :
                    v' insert cmp t v cmp v v' = Ordering.eq
                    theorem RBTree.RBNode.exists_find?_insert_self {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {c : RBColor} {n : Nat} {v : α} [Std.TransCmp cmp] [IsCut cmp cut] {t : RBNode α} (ht : t.Balanced c n) (ht₂ : Ordered cmp t) (hv : cut v = Ordering.eq) :
                    (x : α), find? cut (insert cmp t v) = some x
                    theorem RBTree.RBNode.find?_insert_self {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {c : RBColor} {n : Nat} {v : α} [Std.TransCmp cmp] [IsStrictCut cmp cut] {t : RBNode α} (ht : t.Balanced c n) (ht₂ : Ordered cmp t) (hv : cut v = Ordering.eq) :
                    find? cut (insert cmp t v) = some v
                    theorem RBTree.RBNode.mem_insert {α : Type u_1} {cmp : ααOrdering} {c : RBColor} {n : Nat} {v v' : α} [Std.TransCmp cmp] {t : RBNode α} (ht : t.Balanced c n) (ht₂ : Ordered cmp t) :
                    v' insert cmp t v v' t find? (cmp v) t some v' v' = v
                    @[simp]
                    theorem RBTree.RBSet.val_toList {α : Type u_1} {cmp : ααOrdering} {t : RBSet α cmp} :
                    @[simp]
                    theorem RBTree.RBSet.mkRBSet_eq {α : Type u_1} {cmp : ααOrdering} :
                    mkRBSet α cmp =
                    @[simp]
                    theorem RBTree.RBSet.empty_eq {α : Type u_1} {cmp : ααOrdering} :
                    @[simp]
                    theorem RBTree.RBSet.default_eq {α : Type u_1} {cmp : ααOrdering} :
                    @[simp]
                    theorem RBTree.RBSet.empty_toList {α : Type u_1} {cmp : ααOrdering} :
                    @[simp]
                    theorem RBTree.RBSet.single_toList {α : Type u_1} {cmp : ααOrdering} {a : α} :
                    theorem RBTree.RBSet.mem_toList {α : Type u_1} {cmp : ααOrdering} {x : α} {t : RBSet α cmp} :
                    x t.toList x t.val
                    theorem RBTree.RBSet.mem_congr {α : Type u_1} {cmp : ααOrdering} {x y : α} [Std.TransCmp cmp] {t : RBSet α cmp} (h : cmp x y = Ordering.eq) :
                    x t y t
                    theorem RBTree.RBSet.mem_iff_mem_toList {α : Type u_1} {cmp : ααOrdering} {x : α} {t : RBSet α cmp} :
                    x t (y : α), y t.toList cmp x y = Ordering.eq
                    theorem RBTree.RBSet.mem_of_mem_toList {α : Type u_1} {cmp : ααOrdering} {x : α} [Std.OrientedCmp cmp] {t : RBSet α cmp} (h : x t.toList) :
                    x t
                    theorem RBTree.RBSet.foldl_eq_foldl_toList {α : Type u_1} {cmp : ααOrdering} {α✝ : Type u_2} {f : α✝αα✝} {init : α✝} {t : RBSet α cmp} :
                    foldl f init t = List.foldl f init t.toList
                    theorem RBTree.RBSet.foldr_eq_foldr_toList {α : Type u_1} {cmp : ααOrdering} {α✝ : Type u_2} {f : αα✝α✝} {init : α✝} {t : RBSet α cmp} :
                    foldr f init t = List.foldr f init t.toList
                    theorem RBTree.RBSet.foldlM_eq_foldlM_toList {m : Type u_1 → Type u_2} {α : Type u_3} {cmp : ααOrdering} {a✝ : Type u_1} {f : a✝αm a✝} {init : a✝} [Monad m] [LawfulMonad m] {t : RBSet α cmp} :
                    foldlM f init t = List.foldlM f init t.toList
                    theorem RBTree.RBSet.forM_eq_forM_toList {m : Type u_1 → Type u_2} {α : Type u_3} {cmp : ααOrdering} {f : αm PUnit} [Monad m] [LawfulMonad m] {t : RBSet α cmp} :
                    forM f t = t.toList.forM f
                    theorem RBTree.RBSet.forIn_eq_forIn_toList {m : Type u_1 → Type u_2} {α : Type u_3} {cmp : ααOrdering} {α✝ : Type u_1} {init : α✝} {f : αα✝m (ForInStep α✝)} [Monad m] [LawfulMonad m] {t : RBSet α cmp} :
                    forIn t init f = forIn t.toList init f
                    theorem RBTree.RBSet.toStream_eq {α : Type u_1} {cmp : ααOrdering} {t : RBSet α cmp} :
                    @[simp]
                    theorem RBTree.RBSet.toStream_toList {α : Type u_1} {cmp : ααOrdering} {t : RBSet α cmp} :
                    theorem RBTree.RBSet.isEmpty_iff_toList_eq_nil {α : Type u_1} {cmp : ααOrdering} {t : RBSet α cmp} :
                    theorem RBTree.RBSet.toList_sorted {α : Type u_1} {cmp : ααOrdering} {t : RBSet α cmp} :
                    theorem RBTree.RBSet.findP?_some_eq_eq {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {y : α} {t : RBSet α cmp} :
                    t.findP? cut = some ycut y = Ordering.eq
                    theorem RBTree.RBSet.find?_some_eq_eq {α : Type u_1} {cmp : ααOrdering} {x y : α} {t : RBSet α cmp} :
                    t.find? x = some ycmp x y = Ordering.eq
                    theorem RBTree.RBSet.findP?_some_mem_toList {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {y : α} {t : RBSet α cmp} (h : t.findP? cut = some y) :
                    theorem RBTree.RBSet.find?_some_mem_toList {α : Type u_1} {cmp : ααOrdering} {x y : α} {t : RBSet α cmp} (h : t.find? x = some y) :
                    theorem RBTree.RBSet.findP?_some_memP {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {y : α} {t : RBSet α cmp} (h : t.findP? cut = some y) :
                    MemP cut t
                    theorem RBTree.RBSet.find?_some_mem {α : Type u_1} {cmp : ααOrdering} {x y : α} {t : RBSet α cmp} (h : t.find? x = some y) :
                    x t
                    theorem RBTree.RBSet.mem_toList_unique {α : Type u_1} {cmp : ααOrdering} {x y : α} [Std.TransCmp cmp] {t : RBSet α cmp} (hx : x t.toList) (hy : y t.toList) (e : cmp x y = Ordering.eq) :
                    x = y
                    theorem RBTree.RBSet.findP?_some {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {y : α} [Std.TransCmp cmp] [RBNode.IsStrictCut cmp cut] {t : RBSet α cmp} :
                    t.findP? cut = some y y t.toList cut y = Ordering.eq
                    theorem RBTree.RBSet.find?_some {α : Type u_1} {cmp : ααOrdering} {x y : α} [Std.TransCmp cmp] {t : RBSet α cmp} :
                    t.find? x = some y y t.toList cmp x y = Ordering.eq
                    theorem RBTree.RBSet.memP_iff_findP? {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} [Std.TransCmp cmp] [RBNode.IsCut cmp cut] {t : RBSet α cmp} :
                    MemP cut t (y : α), t.findP? cut = some y
                    theorem RBTree.RBSet.mem_iff_find? {α : Type u_1} {cmp : ααOrdering} {x : α} [Std.TransCmp cmp] {t : RBSet α cmp} :
                    x t (y : α), t.find? x = some y
                    @[simp]
                    theorem RBTree.RBSet.contains_iff {α : Type u_1} {cmp : ααOrdering} {x : α} [Std.TransCmp cmp] {t : RBSet α cmp} :
                    @[implicit_reducible]
                    instance RBTree.RBSet.instDecidableMemOfTransCmp {α : Type u_1} {cmp : ααOrdering} {x : α} [Std.TransCmp cmp] {t : RBSet α cmp} :
                    Equations
                    theorem RBTree.RBSet.size_eq {α : Type u_1} {cmp : ααOrdering} (t : RBSet α cmp) :
                    theorem RBTree.RBSet.mem_toList_insert_self {α : Type u_1} {cmp : ααOrdering} (v : α) (t : RBSet α cmp) :
                    v (t.insert v).toList
                    theorem RBTree.RBSet.mem_insert_self {α : Type u_1} {cmp : ααOrdering} [Std.OrientedCmp cmp] (v : α) (t : RBSet α cmp) :
                    v t.insert v
                    theorem RBTree.RBSet.mem_insert_of_eq {α : Type u_1} {cmp : ααOrdering} {v v' : α} [Std.TransCmp cmp] (t : RBSet α cmp) (h : cmp v v' = Ordering.eq) :
                    v' t.insert v
                    theorem RBTree.RBSet.mem_toList_insert_of_mem {α : Type u_1} {cmp : ααOrdering} {v' : α} (v : α) {t : RBSet α cmp} (h : v' t.toList) :
                    v' (t.insert v).toList cmp v v' = Ordering.eq
                    theorem RBTree.RBSet.mem_insert_of_mem_toList {α : Type u_1} {cmp : ααOrdering} {v' : α} [Std.OrientedCmp cmp] (v : α) {t : RBSet α cmp} (h : v' t.toList) :
                    v' t.insert v
                    theorem RBTree.RBSet.mem_insert_of_mem {α : Type u_1} {cmp : ααOrdering} {v' : α} [Std.TransCmp cmp] (v : α) {t : RBSet α cmp} (h : v' t) :
                    v' t.insert v
                    theorem RBTree.RBSet.mem_toList_insert {α : Type u_1} {cmp : ααOrdering} {v v' : α} [Std.TransCmp cmp] {t : RBSet α cmp} :
                    v' (t.insert v).toList v' t.toList t.find? v some v' v' = v
                    theorem RBTree.RBSet.mem_insert {α : Type u_1} {cmp : ααOrdering} {v v' : α} [Std.TransCmp cmp] {t : RBSet α cmp} :
                    v' t.insert v v' t cmp v v' = Ordering.eq
                    theorem RBTree.RBSet.find?_congr {α : Type u_1} {cmp : ααOrdering} {v₁ v₂ : α} [Std.TransCmp cmp] (t : RBSet α cmp) (h : cmp v₁ v₂ = Ordering.eq) :
                    t.find? v₁ = t.find? v₂
                    theorem RBTree.RBSet.findP?_insert_of_eq {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {v : α} [Std.TransCmp cmp] [RBNode.IsStrictCut cmp cut] (t : RBSet α cmp) (h : cut v = Ordering.eq) :
                    (t.insert v).findP? cut = some v
                    theorem RBTree.RBSet.find?_insert_of_eq {α : Type u_1} {cmp : ααOrdering} {v' v : α} [Std.TransCmp cmp] (t : RBSet α cmp) (h : cmp v' v = Ordering.eq) :
                    (t.insert v).find? v' = some v
                    theorem RBTree.RBSet.findP?_insert_of_ne {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {v : α} [Std.TransCmp cmp] [RBNode.IsStrictCut cmp cut] (t : RBSet α cmp) (h : cut v Ordering.eq) :
                    (t.insert v).findP? cut = t.findP? cut
                    theorem RBTree.RBSet.find?_insert_of_ne {α : Type u_1} {cmp : ααOrdering} {v' v : α} [Std.TransCmp cmp] (t : RBSet α cmp) (h : cmp v' v Ordering.eq) :
                    (t.insert v).find? v' = t.find? v'
                    theorem RBTree.RBSet.findP?_insert {α : Type u_1} {cmp : ααOrdering} [Std.TransCmp cmp] (t : RBSet α cmp) (v : α) (cut : αOrdering) [RBNode.IsStrictCut cmp cut] :
                    (t.insert v).findP? cut = if cut v = Ordering.eq then some v else t.findP? cut
                    theorem RBTree.RBSet.find?_insert {α : Type u_1} {cmp : ααOrdering} [Std.TransCmp cmp] (t : RBSet α cmp) (v v' : α) :
                    (t.insert v).find? v' = if cmp v' v = Ordering.eq then some v else t.find? v'
                    theorem RBTree.RBSet.upperBoundP?_eq_findP? {α : Type u_1} {cmp : ααOrdering} {x : α} {t : RBSet α cmp} {cut : αOrdering} (H : t.findP? cut = some x) :
                    theorem RBTree.RBSet.lowerBoundP?_eq_findP? {α : Type u_1} {cmp : ααOrdering} {x : α} {t : RBSet α cmp} {cut : αOrdering} (H : t.findP? cut = some x) :
                    theorem RBTree.RBSet.upperBound?_eq_find? {α : Type u_1} {cmp : ααOrdering} {x y : α} {t : RBSet α cmp} (H : t.find? x = some y) :
                    theorem RBTree.RBSet.lowerBound?_eq_find? {α : Type u_1} {cmp : ααOrdering} {x y : α} {t : RBSet α cmp} (H : t.find? x = some y) :
                    theorem RBTree.RBSet.upperBoundP?_ge {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {x : α} {t : RBSet α cmp} :
                    t.upperBoundP? cut = some xcut x Ordering.gt

                    The value x returned by upperBoundP? is greater or equal to the cut.

                    theorem RBTree.RBSet.upperBound?_ge {α : Type u_1} {cmp : ααOrdering} {x y : α} {t : RBSet α cmp} :
                    t.upperBound? x = some ycmp x y Ordering.gt

                    The value y returned by upperBound? x is greater or equal to x.

                    theorem RBTree.RBSet.lowerBoundP?_le {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {x : α} {t : RBSet α cmp} :
                    t.lowerBoundP? cut = some xcut x Ordering.lt

                    The value x returned by lowerBoundP? is less or equal to the cut.

                    theorem RBTree.RBSet.lowerBound?_le {α : Type u_1} {cmp : ααOrdering} {x y : α} {t : RBSet α cmp} :
                    t.lowerBound? x = some ycmp x y Ordering.lt

                    The value y returned by lowerBound? x is less or equal to x.

                    theorem RBTree.RBSet.upperBoundP?_mem_toList {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {x : α} {t : RBSet α cmp} (h : t.upperBoundP? cut = some x) :
                    theorem RBTree.RBSet.upperBound?_mem_toList {α : Type u_1} {cmp : ααOrdering} {x y : α} {t : RBSet α cmp} (h : t.upperBound? x = some y) :
                    theorem RBTree.RBSet.lowerBoundP?_mem_toList {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {x : α} {t : RBSet α cmp} (h : t.lowerBoundP? cut = some x) :
                    theorem RBTree.RBSet.lowerBound?_mem_toList {α : Type u_1} {cmp : ααOrdering} {x y : α} {t : RBSet α cmp} (h : t.lowerBound? x = some y) :
                    theorem RBTree.RBSet.upperBoundP?_mem {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {x : α} [Std.OrientedCmp cmp] {t : RBSet α cmp} (h : t.upperBoundP? cut = some x) :
                    x t
                    theorem RBTree.RBSet.lowerBoundP?_mem {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {x : α} [Std.OrientedCmp cmp] {t : RBSet α cmp} (h : t.lowerBoundP? cut = some x) :
                    x t
                    theorem RBTree.RBSet.upperBound?_mem {α : Type u_1} {cmp : ααOrdering} {x y : α} [Std.OrientedCmp cmp] {t : RBSet α cmp} (h : t.upperBound? x = some y) :
                    y t
                    theorem RBTree.RBSet.lowerBound?_mem {α : Type u_1} {cmp : ααOrdering} {x y : α} [Std.OrientedCmp cmp] {t : RBSet α cmp} (h : t.lowerBound? x = some y) :
                    y t
                    theorem RBTree.RBSet.upperBoundP?_exists {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBSet α cmp} [Std.TransCmp cmp] [RBNode.IsCut cmp cut] :
                    ( (x : α), t.upperBoundP? cut = some x) (x : α), x t cut x Ordering.gt
                    theorem RBTree.RBSet.lowerBoundP?_exists {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBSet α cmp} [Std.TransCmp cmp] [RBNode.IsCut cmp cut] :
                    ( (x : α), t.lowerBoundP? cut = some x) (x : α), x t cut x Ordering.lt
                    theorem RBTree.RBSet.upperBound?_exists {α : Type u_1} {cmp : ααOrdering} {x : α} {t : RBSet α cmp} [Std.TransCmp cmp] :
                    ( (y : α), t.upperBound? x = some y) (y : α), y t cmp x y Ordering.gt
                    theorem RBTree.RBSet.lowerBound?_exists {α : Type u_1} {cmp : ααOrdering} {x : α} {t : RBSet α cmp} [Std.TransCmp cmp] :
                    ( (y : α), t.lowerBound? x = some y) (y : α), y t cmp x y Ordering.lt
                    theorem RBTree.RBSet.upperBoundP?_least {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {x y : α} {t : RBSet α cmp} [Std.TransCmp cmp] [RBNode.IsCut cmp cut] (H : t.upperBoundP? cut = some x) (hy : y t) (xy : cmp y x = Ordering.lt) (hx : cut x = Ordering.lt) :

                    A statement of the least-ness of the result of upperBoundP?. If x is the return value of upperBoundP? and it is strictly greater than the cut, then any other y < x in the tree is in fact strictly less than the cut (so there is no exact match, and nothing closer to the cut).

                    theorem RBTree.RBSet.lowerBoundP?_greatest {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {x y : α} {t : RBSet α cmp} [Std.TransCmp cmp] [RBNode.IsCut cmp cut] (H : t.lowerBoundP? cut = some x) (hy : y t) (xy : cmp x y = Ordering.lt) (hx : cut x = Ordering.gt) :

                    A statement of the greatest-ness of the result of lowerBoundP?. If x is the return value of lowerBoundP? and it is strictly less than the cut, then any other y > x in the tree is in fact strictly greater than the cut (so there is no exact match, and nothing closer to the cut).

                    theorem RBTree.RBSet.memP_iff_upperBoundP? {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBSet α cmp} [Std.TransCmp cmp] [RBNode.IsCut cmp cut] :
                    MemP cut t (x : α), t.upperBoundP? cut = some x cut x = Ordering.eq
                    theorem RBTree.RBSet.memP_iff_lowerBoundP? {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {t : RBSet α cmp} [Std.TransCmp cmp] [RBNode.IsCut cmp cut] :
                    MemP cut t (x : α), t.lowerBoundP? cut = some x cut x = Ordering.eq
                    theorem RBTree.RBSet.mem_iff_upperBound? {α : Type u_1} {cmp : ααOrdering} {x : α} {t : RBSet α cmp} [Std.TransCmp cmp] :
                    x t (y : α), t.upperBound? x = some y cmp x y = Ordering.eq
                    theorem RBTree.RBSet.mem_iff_lowerBound? {α : Type u_1} {cmp : ααOrdering} {x : α} {t : RBSet α cmp} [Std.TransCmp cmp] :
                    x t (y : α), t.lowerBound? x = some y cmp x y = Ordering.eq
                    theorem RBTree.RBSet.lt_upperBoundP? {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {x y : α} {t : RBSet α cmp} [Std.TransCmp cmp] [RBNode.IsStrictCut cmp cut] (H : t.upperBoundP? cut = some x) (hy : y t) :
                    cmp y x = Ordering.lt cut y = Ordering.gt

                    A stronger version of upperBoundP?_least that holds when the cut is strict.

                    theorem RBTree.RBSet.lowerBoundP?_lt {α : Type u_1} {cmp : ααOrdering} {cut : αOrdering} {x y : α} {t : RBSet α cmp} [Std.TransCmp cmp] [RBNode.IsStrictCut cmp cut] (H : t.lowerBoundP? cut = some x) (hy : y t) :
                    cmp x y = Ordering.lt cut y = Ordering.lt

                    A stronger version of lowerBoundP?_greatest that holds when the cut is strict.

                    theorem RBTree.RBSet.lt_upperBound? {α : Type u_1} {cmp : ααOrdering} {x y z : α} {t : RBSet α cmp} [Std.TransCmp cmp] (H : t.upperBound? x = some y) (hz : z t) :
                    cmp z y = Ordering.lt cmp z x = Ordering.lt
                    theorem RBTree.RBSet.lowerBound?_lt {α : Type u_1} {cmp : ααOrdering} {x y z : α} {t : RBSet α cmp} [Std.TransCmp cmp] (H : t.lowerBound? x = some y) (hz : z t) :
                    cmp y z = Ordering.lt cmp x z = Ordering.lt
                    theorem RBTree.RBMap.val_toList {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {t : RBMap α β cmp} :
                    @[simp]
                    theorem RBTree.RBMap.mkRBSet_eq {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} :
                    mkRBMap α β cmp =
                    @[simp]
                    theorem RBTree.RBMap.empty_eq {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} :
                    @[simp]
                    theorem RBTree.RBMap.default_eq {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} :
                    @[simp]
                    theorem RBTree.RBMap.empty_toList {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} :
                    @[simp]
                    theorem RBTree.RBMap.single_toList {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {a : α} {b : β} :
                    (single a b).toList = [(a, b)]
                    theorem RBTree.RBMap.mem_toList {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {x : α × β} {t : RBMap α β cmp} :
                    x t.toList x t.val
                    theorem RBTree.RBMap.foldl_eq_foldl_toList {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {α✝ : Type u_3} {f : α✝αβα✝} {init : α✝} {t : RBMap α β cmp} :
                    foldl f init t = List.foldl (fun (r : α✝) (p : α × β) => f r p.fst p.snd) init t.toList
                    theorem RBTree.RBMap.foldr_eq_foldr_toList {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {α✝ : Type u_3} {f : αβα✝α✝} {init : α✝} {t : RBMap α β cmp} :
                    foldr f init t = List.foldr (fun (p : α × β) (r : α✝) => f p.fst p.snd r) init t.toList
                    theorem RBTree.RBMap.foldlM_eq_foldlM_toList {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {cmp : ααOrdering} {a✝ : Type u_1} {f : a✝αβm a✝} {init : a✝} [Monad m] [LawfulMonad m] {t : RBMap α β cmp} :
                    foldlM f init t = List.foldlM (fun (r : a✝) (p : α × β) => f r p.fst p.snd) init t.toList
                    theorem RBTree.RBMap.forM_eq_forM_toList {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {cmp : ααOrdering} {f : αβm PUnit} [Monad m] [LawfulMonad m] {t : RBMap α β cmp} :
                    forM f t = t.toList.forM fun (p : α × β) => f p.fst p.snd
                    theorem RBTree.RBMap.forIn_eq_forIn_toList {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_4} {cmp : ααOrdering} {α✝ : Type u_1} {init : α✝} {f : α × βα✝m (ForInStep α✝)} [Monad m] [LawfulMonad m] {t : RBMap α β cmp} :
                    forIn t init f = forIn t.toList init f
                    theorem RBTree.RBMap.toStream_eq {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {t : RBMap α β cmp} :
                    @[simp]
                    theorem RBTree.RBMap.toStream_toList {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {t : RBMap α β cmp} :
                    theorem RBTree.RBMap.toList_sorted {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {t : RBMap α β cmp} :
                    List.Pairwise (RBNode.cmpLT fun (x1 x2 : α × β) => cmp x1.fst x2.fst) t.toList
                    theorem RBTree.RBMap.findEntry?_some_eq_eq {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {x y : α} {v : β} {t : RBMap α β cmp} :
                    t.findEntry? x = some (y, v)cmp x y = Ordering.eq
                    theorem RBTree.RBMap.findEntry?_some_mem_toList {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {x : α} {y : α × β} {t : RBMap α β cmp} (h : t.findEntry? x = some y) :
                    theorem RBTree.RBMap.find?_some_mem_toList {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {x : α} {v : β} {t : RBMap α β cmp} (h : t.find? x = some v) :
                    (y : α), (y, v) t.toList cmp x y = Ordering.eq
                    theorem RBTree.RBMap.mem_toList_unique {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} {x y : α × β} [Std.TransCmp cmp] {t : RBMap α β cmp} (hx : x t.toList) (hy : y t.toList) (e : cmp x.fst y.fst = Ordering.eq) :
                    x = y
                    instance RBTree.RBMap.instIsStrictCut {α : Type u_1} (cmp : ααOrdering) (a : α) :
                    RBNode.IsStrictCut cmp (cmp a)

                    A "representable cut" is one generated by cmp a for some a. This is always a valid cut.

                    instance RBTree.RBMap.instIsStrictCutByKeyOfTransCmp {α : Type u_1} {β : Type u_2} (f : αβ) (cmp : ββOrdering) [Std.TransCmp cmp] (x : β) :
                    RBNode.IsStrictCut (Ordering.byKey f cmp) fun (y : α) => cmp x (f y)
                    theorem RBTree.RBMap.findEntry?_some {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} {x : α} {y : α × β} [Std.TransCmp cmp] {t : RBMap α β cmp} :
                    theorem RBTree.RBMap.find?_some {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} {x : α} {v : β} [Std.TransCmp cmp] {t : RBMap α β cmp} :
                    t.find? x = some v (y : α), (y, v) t.toList cmp x y = Ordering.eq
                    theorem RBTree.RBMap.contains_iff_findEntry? {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {x : α} {t : RBMap α β cmp} :
                    t.contains x = true (v : α × β), t.findEntry? x = some v
                    theorem RBTree.RBMap.contains_iff_find? {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {x : α} {t : RBMap α β cmp} :
                    t.contains x = true (v : β), t.find? x = some v
                    theorem RBTree.RBMap.size_eq {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} (t : RBMap α β cmp) :
                    theorem RBTree.RBMap.mem_toList_insert_self {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {k : α} (v : β) (t : RBMap α β cmp) :
                    (k, v) (t.insert k v).toList
                    theorem RBTree.RBMap.mem_toList_insert_of_mem {α : Type u_1} {β : Type u_2} {cmp : ααOrdering} {y : α × β} {k : α} (v : β) {t : RBMap α β cmp} (h : y t.toList) :
                    y (t.insert k v).toList cmp k y.fst = Ordering.eq
                    theorem RBTree.RBMap.mem_toList_insert {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} {k : α} {v : β} {y : α × β} [Std.TransCmp cmp] {t : RBMap α β cmp} :
                    y (t.insert k v).toList y t.toList t.findEntry? k some y y = (k, v)
                    theorem RBTree.RBMap.findEntry?_congr {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} {k₁ k₂ : α} [Std.TransCmp cmp] (t : RBMap α β cmp) (h : cmp k₁ k₂ = Ordering.eq) :
                    t.findEntry? k₁ = t.findEntry? k₂
                    theorem RBTree.RBMap.find?_congr {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} {k₁ k₂ : α} [Std.TransCmp cmp] (t : RBMap α β cmp) (h : cmp k₁ k₂ = Ordering.eq) :
                    t.find? k₁ = t.find? k₂
                    theorem RBTree.RBMap.findEntry?_insert_of_eq {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} {k' k : α} {v : β} [Std.TransCmp cmp] (t : RBMap α β cmp) (h : cmp k' k = Ordering.eq) :
                    (t.insert k v).findEntry? k' = some (k, v)
                    theorem RBTree.RBMap.find?_insert_of_eq {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} {k' k : α} {v : β} [Std.TransCmp cmp] (t : RBMap α β cmp) (h : cmp k' k = Ordering.eq) :
                    (t.insert k v).find? k' = some v
                    theorem RBTree.RBMap.findEntry?_insert_of_ne {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} {k' k : α} {v : β} [Std.TransCmp cmp] (t : RBMap α β cmp) (h : cmp k' k Ordering.eq) :
                    (t.insert k v).findEntry? k' = t.findEntry? k'
                    theorem RBTree.RBMap.find?_insert_of_ne {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} {k' k : α} {v : β} [Std.TransCmp cmp] (t : RBMap α β cmp) (h : cmp k' k Ordering.eq) :
                    (t.insert k v).find? k' = t.find? k'
                    theorem RBTree.RBMap.findEntry?_insert {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} [Std.TransCmp cmp] (t : RBMap α β cmp) (k : α) (v : β) (k' : α) :
                    (t.insert k v).findEntry? k' = if cmp k' k = Ordering.eq then some (k, v) else t.findEntry? k'
                    theorem RBTree.RBMap.find?_insert {α : Type u_1} {cmp : ααOrdering} {β : Type u_2} [Std.TransCmp cmp] (t : RBMap α β cmp) (k : α) (v : β) (k' : α) :
                    (t.insert k v).find? k' = if cmp k' k = Ordering.eq then some v else t.find? k'