- 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) = (f (Lean.RBNode.depth f l) (Lean.RBNode.depth f r)).succ
Instances For
Equations
- Lean.RBNode.leaf.min = none
- (Lean.RBNode.node color Lean.RBNode.leaf k v rchild).min = some ⟨k, v⟩
- (Lean.RBNode.node color l key val rchild).min = l.min
Instances For
Equations
- Lean.RBNode.leaf.max = none
- (Lean.RBNode.node color lchild k v Lean.RBNode.leaf).max = some ⟨k, v⟩
- (Lean.RBNode.node color lchild key val r).max = r.max
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
- as.forIn 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
- (Lean.RBNode.node color Lean.RBNode.leaf key val Lean.RBNode.leaf).isSingleton = true
- x.isSingleton = false
Instances For
Equations
- One or more equations did not get rendered due to their size.
- x✝².balance1 x✝¹ x✝ x = Lean.RBNode.node Lean.RBColor.black x✝² x✝¹ x✝ x
Instances For
Equations
- One or more equations did not get rendered due to their size.
- x✝².balance2 x✝¹ x✝ x = Lean.RBNode.node Lean.RBColor.black x✝² x✝¹ x✝ x
Instances For
Equations
- (Lean.RBNode.node Lean.RBColor.red lchild key val rchild).isRed = true
- x.isRed = false
Instances For
Equations
- (Lean.RBNode.node Lean.RBColor.black lchild key val rchild).isBlack = true
- x.isBlack = 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.node color l k v r).setBlack = Lean.RBNode.node Lean.RBColor.black l k v r
- x.setBlack = x
Instances For
Equations
- Lean.RBNode.insert cmp t k v = if t.isRed = true then (Lean.RBNode.ins cmp t k v).setBlack else Lean.RBNode.ins cmp t k v
Instances For
Equations
- (Lean.RBNode.node color l k v r).setRed = Lean.RBNode.node Lean.RBColor.red l k v r
- x.setRed = x
Instances For
Equations
- One or more equations did not get rendered due to their size.
- (Lean.RBNode.node Lean.RBColor.red a kx vx b).balLeft x✝¹ x✝ x = Lean.RBNode.node Lean.RBColor.red (Lean.RBNode.node Lean.RBColor.black a kx vx b) x✝¹ x✝ x
- x✝¹.balLeft x✝ x (Lean.RBNode.node Lean.RBColor.black a ky vy b) = x✝¹.balance2 x✝ x (Lean.RBNode.node Lean.RBColor.red a ky vy b)
- x✝².balLeft x✝¹ x✝ x = Lean.RBNode.node Lean.RBColor.red x✝² x✝¹ x✝ x
Instances For
Equations
- One or more equations did not get rendered due to their size.
- l.balRight k v (Lean.RBNode.node Lean.RBColor.red lchild key val rchild) = Lean.RBNode.node Lean.RBColor.red l k v (Lean.RBNode.node Lean.RBColor.black lchild key val rchild)
- (Lean.RBNode.node Lean.RBColor.black a kx vx b).balRight k v r = (Lean.RBNode.node Lean.RBColor.red a kx vx b).balance1 k v r
- l.balRight k v r = Lean.RBNode.node Lean.RBColor.red l k v r
Instances For
The number of nodes in the tree.
Equations
- Lean.RBNode.leaf.size = 0
- (Lean.RBNode.node color l key val r).size = l.size + r.size + 1
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Lean.RBNode.leaf.appendTrees x = x
- x.appendTrees Lean.RBNode.leaf = x
- x.appendTrees (Lean.RBNode.node Lean.RBColor.red b kx vx c) = Lean.RBNode.node Lean.RBColor.red (x.appendTrees b) kx vx c
- (Lean.RBNode.node Lean.RBColor.red a kx vx b).appendTrees x = Lean.RBNode.node Lean.RBColor.red a kx vx (b.appendTrees 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 = (Lean.RBNode.del cmp x t).setBlack
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
- Lean.RBNode.find cmp Lean.RBNode.leaf x = none
- Lean.RBNode.find cmp (Lean.RBNode.node color a ky vy b) x = match cmp x ky with | Ordering.lt => Lean.RBNode.find cmp a x | Ordering.gt => Lean.RBNode.find cmp b x | Ordering.eq => some vy
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
- n.toArray = Lean.RBNode.fold (fun (acc : Array (Sigma β)) (k : α) (v : β k) => acc.push ⟨k, v⟩) ∅ n
Instances For
Equations
- Lean.RBNode.instEmptyCollection = { emptyCollection := Lean.RBNode.leaf }
Equations
- Lean.RBMap α β cmp = { t : Lean.RBNode α fun (x : α) => β // Lean.RBNode.WellFormed cmp t }
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
- t.isSingleton = t.val.isSingleton
Instances For
Equations
- Lean.RBMap.fold f x ⟨t, property⟩ = Lean.RBNode.fold f x t
Instances For
Equations
- Lean.RBMap.revFold f x ⟨t, property⟩ = Lean.RBNode.revFold f x t
Instances For
Equations
- Lean.RBMap.foldM f x ⟨t, property⟩ = Lean.RBNode.foldM f x t
Instances For
Equations
- Lean.RBMap.forM f t = Lean.RBMap.foldM (fun (x : PUnit) (k : α) (v : β) => f k v) PUnit.unit t
Instances For
Equations
- t.forIn init f = t.val.forIn init fun (a : α) (b : β) (acc : σ) => f (a, b) acc
Instances For
Equations
- Lean.RBMap.isEmpty ⟨Lean.RBNode.leaf, property⟩ = true
- x.isEmpty = false
Instances For
Equations
- Lean.RBMap.toList ⟨t, property⟩ = Lean.RBNode.revFold (fun (ps : List (α × β)) (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 ⟨t, property⟩ = match t.min with | some ⟨k, 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 ⟨t, property⟩ = match t.max with | some ⟨k, v⟩ => some (k, v) | none => none
Instances For
Equations
- Lean.RBMap.instRepr = { reprPrec := fun (m : Lean.RBMap α β cmp) (prec : Nat) => Repr.addAppParen (Std.Format.text "Lean.rbmapOf " ++ repr m.toList) prec }
Equations
- Lean.RBMap.insert ⟨t, w⟩ x✝ x = ⟨Lean.RBNode.insert cmp t x✝ x, ⋯⟩
Instances For
Equations
- Lean.RBMap.erase ⟨t, w⟩ x = ⟨Lean.RBNode.erase cmp x t, ⋯⟩
Instances For
Equations
- Lean.RBMap.ofList [] = Lean.mkRBMap α β cmp
- Lean.RBMap.ofList ((k, v) :: xs) = (Lean.RBMap.ofList xs).insert k v
Instances For
Equations
- Lean.RBMap.findCore? ⟨t, w⟩ x = Lean.RBNode.findCore cmp t x
Instances For
Equations
- Lean.RBMap.find? ⟨t, w⟩ x = Lean.RBNode.find cmp t x
Instances For
Equations
- t.findD k v₀ = (t.find? k).getD 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 ⟨t, w⟩ x = Lean.RBNode.lowerBound cmp t x none
Instances For
Returns true if the given key a
is in the RBMap.
Equations
- t.contains a = (t.find? a).isSome
Instances For
Equations
- Lean.RBMap.fromList l cmp = List.foldl (fun (r : Lean.RBMap α β cmp) (p : α × β) => r.insert p.fst p.snd) (Lean.mkRBMap α β cmp) l
Instances For
Equations
- Lean.RBMap.fromArray l cmp = Array.foldl (fun (r : Lean.RBMap α β cmp) (p : α × β) => r.insert p.fst p.snd) (Lean.mkRBMap α β cmp) l
Instances For
Returns true if the given predicate is true for all items in the RBMap.
Equations
- Lean.RBMap.all ⟨t, property⟩ x = Lean.RBNode.all x t
Instances For
Returns true if the given predicate is true for any item in the RBMap.
Equations
- Lean.RBMap.any ⟨t, property⟩ x = Lean.RBNode.any x t
Instances For
The number of items in the RBMap.
Equations
- m.size = Lean.RBMap.fold (fun (sz : Nat) (x : α) (x : β) => sz + 1) 0 m
Instances For
Equations
- t.maxDepth = Lean.RBNode.depth Nat.max t.val
Instances For
Equations
- t.min! = match t.min with | some p => p | none => panicWithPosWithDecl "Lean.Data.RBMap" "Lean.RBMap.min!" 373 14 "map is empty"
Instances For
Equations
- t.max! = match t.max with | some p => p | none => panicWithPosWithDecl "Lean.Data.RBMap" "Lean.RBMap.max!" 378 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
- t.find! k = match t.find? k with | some b => b | none => panicWithPosWithDecl "Lean.Data.RBMap" "Lean.RBMap.find!" 384 14 "key is not in the map"
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