- leaf: {α : Type u} → {β : α → Type v} → Lean.RBNode α β
- node: {α : Type u} → {β : α → Type v} → Lean.RBColor → Lean.RBNode α β → (key : α) → β key → Lean.RBNode α β → Lean.RBNode α β
Instances For
Equations
- Lean.RBNode.depth f Lean.RBNode.leaf = 0
- Lean.RBNode.depth f (Lean.RBNode.node color l key val r) = Nat.succ (f (Lean.RBNode.depth f l) (Lean.RBNode.depth f r))
Instances For
Equations
- Lean.RBNode.min Lean.RBNode.leaf = none
- Lean.RBNode.min (Lean.RBNode.node color Lean.RBNode.leaf k v rchild) = some { fst := k, snd := v }
- Lean.RBNode.min (Lean.RBNode.node color l key val rchild) = Lean.RBNode.min l
Instances For
Equations
- Lean.RBNode.max Lean.RBNode.leaf = none
- Lean.RBNode.max (Lean.RBNode.node color lchild k v Lean.RBNode.leaf) = some { fst := k, snd := v }
- Lean.RBNode.max (Lean.RBNode.node color lchild key val r) = Lean.RBNode.max r
Instances For
Equations
- Lean.RBNode.fold f x Lean.RBNode.leaf = x
- Lean.RBNode.fold f x (Lean.RBNode.node color l k v r) = Lean.RBNode.fold f (f (Lean.RBNode.fold f x l) k v) r
Instances For
Equations
- Lean.RBNode.forM f Lean.RBNode.leaf = pure ()
- Lean.RBNode.forM f (Lean.RBNode.node color l key val r) = do Lean.RBNode.forM f l f key val Lean.RBNode.forM f r
Instances For
Equations
- Lean.RBNode.foldM f x Lean.RBNode.leaf = pure x
- Lean.RBNode.foldM f x (Lean.RBNode.node color l k v r) = do let b ← Lean.RBNode.foldM f x l let b ← f b k v Lean.RBNode.foldM f b r
Instances For
Equations
- Lean.RBNode.forIn as init f = do let __do_lift ← Lean.RBNode.forIn.visit f as init match __do_lift with | ForInStep.done b => pure b | ForInStep.yield b => pure b
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.RBNode.forIn.visit f Lean.RBNode.leaf x = pure (ForInStep.yield x)
Instances For
Equations
- Lean.RBNode.revFold f x Lean.RBNode.leaf = x
- Lean.RBNode.revFold f x (Lean.RBNode.node color l k v r) = Lean.RBNode.revFold f (f (Lean.RBNode.revFold f x r) k v) l
Instances For
Equations
- Lean.RBNode.all p Lean.RBNode.leaf = true
- Lean.RBNode.all p (Lean.RBNode.node color l key val r) = (p key val && Lean.RBNode.all p l && Lean.RBNode.all p r)
Instances For
Equations
- Lean.RBNode.any p Lean.RBNode.leaf = false
- Lean.RBNode.any p (Lean.RBNode.node color l key val r) = (p key val || Lean.RBNode.any p l || Lean.RBNode.any p r)
Instances For
Equations
- Lean.RBNode.singleton k v = Lean.RBNode.node Lean.RBColor.red Lean.RBNode.leaf k v Lean.RBNode.leaf
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.RBNode.isRed x = match x with | Lean.RBNode.node Lean.RBColor.red lchild key val rchild => true | x => false
Instances For
Equations
- Lean.RBNode.isBlack x = match x with | Lean.RBNode.node Lean.RBColor.black lchild key val rchild => true | x => false
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.RBNode.ins cmp Lean.RBNode.leaf x x = Lean.RBNode.node Lean.RBColor.red Lean.RBNode.leaf x x Lean.RBNode.leaf
Instances For
Equations
- Lean.RBNode.setBlack x = match x with | Lean.RBNode.node color l k v r => Lean.RBNode.node Lean.RBColor.black l k v r | e => e
Instances For
Equations
- Lean.RBNode.insert cmp t k v = if Lean.RBNode.isRed t = true then Lean.RBNode.setBlack (Lean.RBNode.ins cmp t k v) else Lean.RBNode.ins cmp t k v
Instances For
Equations
- Lean.RBNode.setRed x = match x with | Lean.RBNode.node color a k v b => Lean.RBNode.node Lean.RBColor.red a k v b | e => e
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The number of nodes in the tree.
Equations
- Lean.RBNode.size Lean.RBNode.leaf = 0
- Lean.RBNode.size (Lean.RBNode.node color l key val r) = Lean.RBNode.size l + Lean.RBNode.size r + 1
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.RBNode.appendTrees Lean.RBNode.leaf x = x
- Lean.RBNode.appendTrees x Lean.RBNode.leaf = x
- Lean.RBNode.appendTrees x (Lean.RBNode.node Lean.RBColor.red b kx vx c) = Lean.RBNode.node Lean.RBColor.red (Lean.RBNode.appendTrees x b) kx vx c
- Lean.RBNode.appendTrees (Lean.RBNode.node Lean.RBColor.red a kx vx b) x = Lean.RBNode.node Lean.RBColor.red a kx vx (Lean.RBNode.appendTrees b x)
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.RBNode.del cmp x Lean.RBNode.leaf = Lean.RBNode.leaf
Instances For
Equations
- Lean.RBNode.erase cmp x t = let t := Lean.RBNode.del cmp x t; Lean.RBNode.setBlack t
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.RBNode.findCore cmp Lean.RBNode.leaf x = none
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.RBNode.find cmp Lean.RBNode.leaf x = none
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.RBNode.lowerBound cmp Lean.RBNode.leaf x x = x
Instances For
- leafWff: ∀ {α : Type u} {β : α → Type v} {cmp : α → α → Ordering}, Lean.RBNode.WellFormed cmp Lean.RBNode.leaf
- insertWff: ∀ {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {n n' : Lean.RBNode α β} {k : α} {v : β k}, Lean.RBNode.WellFormed cmp n → n' = Lean.RBNode.insert cmp n k v → Lean.RBNode.WellFormed cmp n'
- eraseWff: ∀ {α : Type u} {β : α → Type v} {cmp : α → α → Ordering} {n n' : Lean.RBNode α β} {k : α}, Lean.RBNode.WellFormed cmp n → n' = Lean.RBNode.erase cmp k n → Lean.RBNode.WellFormed cmp n'
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.RBNode.mapM f Lean.RBNode.leaf = pure Lean.RBNode.leaf
Instances For
Equations
- Lean.RBNode.map f Lean.RBNode.leaf = Lean.RBNode.leaf
- Lean.RBNode.map f (Lean.RBNode.node color l key val r) = Lean.RBNode.node color (Lean.RBNode.map f l) key (f key val) (Lean.RBNode.map f r)
Instances For
Equations
- Lean.RBNode.toArray n = Lean.RBNode.fold (fun acc k v => Array.push acc { fst := k, snd := v }) ∅ n
Instances For
Equations
- Lean.RBNode.instEmptyCollectionRBNode = { emptyCollection := Lean.RBNode.leaf }
Equations
- Lean.RBMap α β cmp = { t // Lean.RBNode.WellFormed cmp t }
Instances For
Equations
- Lean.mkRBMap α β cmp = { val := Lean.RBNode.leaf, property := (_ : Lean.RBNode.WellFormed cmp Lean.RBNode.leaf) }
Instances For
Equations
- Lean.instEmptyCollectionRBMap α β cmp = { emptyCollection := Lean.RBMap.empty }
Equations
- Lean.instInhabitedRBMap α β cmp = { default := ∅ }
Equations
- Lean.RBMap.depth f t = Lean.RBNode.depth f t.val
Instances For
Equations
- Lean.RBMap.fold f x x = match x, x with | b, { val := t, property := property } => Lean.RBNode.fold f b t
Instances For
Equations
- Lean.RBMap.revFold f x x = match x, x with | b, { val := t, property := property } => Lean.RBNode.revFold f b t
Instances For
Equations
- Lean.RBMap.foldM f x x = match x, x with | b, { val := t, property := property } => Lean.RBNode.foldM f b t
Instances For
Equations
- Lean.RBMap.forM f t = Lean.RBMap.foldM (fun x k v => f k v) PUnit.unit t
Instances For
Equations
- Lean.RBMap.forIn t init f = Lean.RBNode.forIn t.val init fun a b acc => f (a, b) acc
Instances For
Equations
- Lean.RBMap.isEmpty x = match x with | { val := Lean.RBNode.leaf, property := property } => true | x => false
Instances For
Equations
- Lean.RBMap.toList x = match x with | { val := t, property := property } => Lean.RBNode.revFold (fun ps k v => (k, v) :: ps) [] t
Instances For
Returns the kv pair (a,b)
such that a ≤ k
for all keys in the RBMap.
Equations
- Lean.RBMap.min x = match x with | { val := t, property := property } => match Lean.RBNode.min t with | some { fst := k, snd := v } => some (k, v) | none => none
Instances For
Returns the kv pair (a,b)
such that a ≥ k
for all keys in the RBMap.
Equations
- Lean.RBMap.max x = match x with | { val := t, property := property } => match Lean.RBNode.max t with | some { fst := k, snd := v } => some (k, v) | none => none
Instances For
Equations
- Lean.RBMap.instReprRBMap = { reprPrec := fun m prec => Repr.addAppParen (Std.Format.text "Lean.rbmapOf " ++ repr (Lean.RBMap.toList m)) prec }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.RBMap.erase x x = match x, x with | { val := t, property := w }, k => { val := Lean.RBNode.erase cmp k t, property := (_ : Lean.RBNode.WellFormed cmp (Lean.RBNode.erase cmp k t)) }
Instances For
Equations
- Lean.RBMap.ofList [] = Lean.mkRBMap α β cmp
- Lean.RBMap.ofList ((k, v) :: xs) = Lean.RBMap.insert (Lean.RBMap.ofList xs) k v
Instances For
Equations
- Lean.RBMap.findCore? x x = match x, x with | { val := t, property := property }, x => Lean.RBNode.findCore cmp t x
Instances For
Equations
- Lean.RBMap.find? x x = match x, x with | { val := t, property := property }, x => Lean.RBNode.find cmp t x
Instances For
Equations
- Lean.RBMap.findD t k v₀ = Option.getD (Lean.RBMap.find? t k) v₀
Instances For
(lowerBound k) retrieves the kv pair of the largest key smaller than or equal to k
,
if it exists.
Equations
- Lean.RBMap.lowerBound x x = match x, x with | { val := t, property := property }, x => Lean.RBNode.lowerBound cmp t x none
Instances For
Returns true if the given key a
is in the RBMap.
Equations
- Lean.RBMap.contains t a = Option.isSome (Lean.RBMap.find? t a)
Instances For
Equations
- Lean.RBMap.fromList l cmp = List.foldl (fun r p => Lean.RBMap.insert r p.fst p.snd) (Lean.mkRBMap α β cmp) l
Instances For
Equations
- Lean.RBMap.fromArray l cmp = Array.foldl (fun r p => Lean.RBMap.insert r p.fst p.snd) (Lean.mkRBMap α β cmp) l 0 (Array.size l)
Instances For
Returns true if the given predicate is true for all items in the RBMap.
Equations
- Lean.RBMap.all x x = match x, x with | { val := t, property := property }, p => Lean.RBNode.all p t
Instances For
Returns true if the given predicate is true for any item in the RBMap.
Equations
- Lean.RBMap.any x x = match x, x with | { val := t, property := property }, p => Lean.RBNode.any p t
Instances For
The number of items in the RBMap.
Equations
- Lean.RBMap.size m = Lean.RBMap.fold (fun sz x x => sz + 1) 0 m
Instances For
Equations
- Lean.RBMap.maxDepth t = Lean.RBNode.depth Nat.max t.val
Instances For
Equations
- Lean.RBMap.min! t = match Lean.RBMap.min t with | some p => p | none => panicWithPosWithDecl "Lean.Data.RBMap" "Lean.RBMap.min!" 362 14 "map is empty"
Instances For
Equations
- Lean.RBMap.max! t = match Lean.RBMap.max t with | some p => p | none => panicWithPosWithDecl "Lean.Data.RBMap" "Lean.RBMap.max!" 367 14 "map is empty"
Instances For
Attempts to find the value with key k : α
in t
and panics if there is no such key.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Merges the maps t₁
and t₂
, if a key a : α
exists in both,
then use mergeFn a b₁ b₂
to produce the new merged value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Intersects the maps t₁
and t₂
using mergeFn a b₁ b₂
to produce the new value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.rbmapOf l cmp = Lean.RBMap.fromList l cmp