File: .lake/packages/lean4/src/lean/Lean/Data/RBMap.lean

full_name: Lean.RBColor.red
code: inductive RBColor where
  | red | black
goal: Lean.RBColor

full_name: Lean.RBColor
code: inductive RBColor where
  | red | black
goal: Type

full_name: Lean.RBColor.black
code: inductive RBColor where
  | red | black
goal: Lean.RBColor

full_name: Lean.RBNode.node
code: inductive RBNode (α : Type u) (β : α → Type v) where
  | leaf                                                                                        : RBNode α β
  | node  (color : RBColor) (lchild : RBNode α β) (key : α) (val : β key) (rchild : RBNode α β) : RBNode α β
goal: Lean.RBNode α β

full_name: Lean.RBNode.leaf
code: inductive RBNode (α : Type u) (β : α → Type v) where
  | leaf                                                                                        : RBNode α β
  | node  (color : RBColor) (lchild : RBNode α β) (key : α) (val : β key) (rchild : RBNode α β) : RBNode α β
goal: Lean.RBNode α β

full_name: Lean.RBNode
code: inductive RBNode (α : Type u) (β : α → Type v) where
  | leaf                                                                                        : RBNode α β
  | node  (color : RBColor) (lchild : RBNode α β) (key : α) (val : β key) (rchild : RBNode α β) : RBNode α β
goal: Type (max u v)

full_name: Lean.RBNode.depth
code: def depth (f : Nat → Nat → Nat) : RBNode α β → Nat
  
goal: Lean.RBNode α β → Nat

full_name: Lean.RBNode.min
code: protected def min : RBNode α β → Option (Sigma (fun k => β k))
  
goal: Lean.RBNode α β → Option ((k : α) × β k)

full_name: Lean.RBNode.max
code: protected def max : RBNode α β → Option (Sigma (fun k => β k))
  
goal: Lean.RBNode α β → Option ((k : α) × β k)

full_name: Lean.RBNode.fold
code: @[specialize] def fold (f : σ → (k : α) → β k → σ) : (init : σ) → RBNode α β → σ
  
goal: Lean.RBNode α β → σ

full_name: Lean.RBNode.forM
code: @[specialize] def forM [Monad m] (f : (k : α) → β k → m Unit) : RBNode α β → m Unit
  
goal: Lean.RBNode α β → m Unit

full_name: Lean.RBNode.foldM
code: @[specialize] def foldM [Monad m] (f : σ → (k : α) → β k → m σ) : (init : σ) → RBNode α β → m σ
  
goal: Lean.RBNode α β → m σ

full_name: Lean.RBNode.forIn
code: @[inline] protected def forIn [Monad m] (as : RBNode α β) (init : σ) (f : (k : α) → β k → σ → m (ForInStep σ)) : m σ 
goal: m σ

full_name: Lean.RBNode.forIn.visit
code: @[inline] protected def forIn [Monad m] (as : RBNode α β) (init : σ) (f : (k : α) → β k → σ → m (ForInStep σ)) : m σ 
goal: Lean.RBNode α β → σ → m (ForInStep σ)

full_name: Lean.RBNode.revFold
code: @[specialize] def revFold (f : σ → (k : α) → β k → σ) : (init : σ) → RBNode α β → σ
  
goal: Lean.RBNode α β → σ

full_name: Lean.RBNode.all
code: @[specialize] def all (p : (k : α) → β k → Bool) : RBNode α β → Bool
  
goal: Lean.RBNode α β → Bool

full_name: Lean.RBNode.any
code: @[specialize] def any (p : (k : α) → β k → Bool) : RBNode α β → Bool
  
goal: Lean.RBNode α β → Bool

full_name: Lean.RBNode.singleton
code: def singleton (k : α) (v : β k) : RBNode α β 
goal: Lean.RBNode α β

full_name: Lean.RBNode.balance1
code: @[inline] def balance1 : RBNode α β → (a : α) → β a → RBNode α β → RBNode α β
  
goal: Lean.RBNode α β → (a : α) → β a → Lean.RBNode α β → Lean.RBNode α β

full_name: Lean.RBNode.balance2
code: @[inline] def balance2 : RBNode α β → (a : α) → β a → RBNode α β → RBNode α β
  
goal: Lean.RBNode α β → (a : α) → β a → Lean.RBNode α β → Lean.RBNode α β

full_name: Lean.RBNode.isRed
code: def isRed : RBNode α β → Bool
  
goal: Lean.RBNode α β → Bool

full_name: Lean.RBNode.isBlack
code: def isBlack : RBNode α β → Bool
  
goal: Lean.RBNode α β → Bool

full_name: Lean.RBNode.ins
code: @[specialize] def ins : RBNode α β → (k : α) → β k → RBNode α β
  
goal: Lean.RBNode α β → (k : α) → β k → Lean.RBNode α β

full_name: Lean.RBNode.setBlack
code: def setBlack : RBNode α β → RBNode α β
  
goal: Lean.RBNode α β → Lean.RBNode α β

full_name: Lean.RBNode.insert
code: @[specialize] def insert (t : RBNode α β) (k : α) (v : β k) : RBNode α β 
goal: Lean.RBNode α β

full_name: Lean.RBNode.setRed
code: def setRed : RBNode α β → RBNode α β
  
goal: Lean.RBNode α β → Lean.RBNode α β

full_name: Lean.RBNode.balLeft
code: def balLeft : RBNode α β → (k : α) → β k → RBNode α β → RBNode α β
  
goal: Lean.RBNode α β → (k : α) → β k → Lean.RBNode α β → Lean.RBNode α β

full_name: Lean.RBNode.balRight
code: def balRight (l : RBNode α β) (k : α) (v : β k) (r : RBNode α β) : RBNode α β 
goal: Lean.RBNode α β

full_name: Lean.RBNode.size
code: /-- The number of nodes in the tree. -/
@[local simp] def size : RBNode α β → Nat
  
goal: Lean.RBNode α β → Nat

full_name: Lean.RBNode.appendTrees
code: def appendTrees :  RBNode α β → RBNode α β → RBNode α β
  
goal: Lean.RBNode α β → Lean.RBNode α β → Lean.RBNode α β

full_name: Lean.RBNode.del
code: @[specialize] def del (x : α) : RBNode α β → RBNode α β
  
goal: Lean.RBNode α β → Lean.RBNode α β

full_name: Lean.RBNode.erase
code: @[specialize] def erase (x : α) (t : RBNode α β) : RBNode α β 
goal: Lean.RBNode α β

full_name: Lean.RBNode.findCore
code: @[specialize] def findCore : RBNode α β → (k : α) → Option (Sigma (fun k => β k))
  
goal: Lean.RBNode α β → α → Option ((k : α) × β k)

full_name: Lean.RBNode.find
code: @[specialize] def find {β : Type v} : RBNode α (fun _ => β) → α → Option β
  
goal: (Lean.RBNode α fun x => β) → α → Option β

full_name: Lean.RBNode.lowerBound
code: @[specialize] def lowerBound : RBNode α β → α → Option (Sigma β) → Option (Sigma β)
  
goal: Lean.RBNode α β → α → Option (Sigma β) → Option (Sigma β)

full_name: Lean.RBNode.WellFormed
code: inductive WellFormed (cmp : α → α → Ordering) : RBNode α β → Prop where
  | leafWff : WellFormed cmp leaf
  | insertWff {n n' : RBNode α β} {k : α} {v : β k} : WellFormed cmp n → n' = insert cmp n k v → WellFormed cmp n'
  | eraseWff {n n' : RBNode α β} {k : α} : WellFormed cmp n → n' = erase cmp k n → WellFormed cmp n'
goal: Lean.RBNode α β → Prop

full_name: Lean.RBNode.WellFormed.insertWff
code: inductive WellFormed (cmp : α → α → Ordering) : RBNode α β → Prop where
  | leafWff : WellFormed cmp leaf
  | insertWff {n n' : RBNode α β} {k : α} {v : β k} : WellFormed cmp n → n' = insert cmp n k v → WellFormed cmp n'
  | eraseWff {n n' : RBNode α β} {k : α} : WellFormed cmp n → n' = erase cmp k n → WellFormed cmp n'
goal: Lean.RBNode.WellFormed cmp n → n' = Lean.RBNode.insert cmp n k v → Lean.RBNode.WellFormed cmp n'

full_name: Lean.RBNode.WellFormed.eraseWff
code: inductive WellFormed (cmp : α → α → Ordering) : RBNode α β → Prop where
  | leafWff : WellFormed cmp leaf
  | insertWff {n n' : RBNode α β} {k : α} {v : β k} : WellFormed cmp n → n' = insert cmp n k v → WellFormed cmp n'
  | eraseWff {n n' : RBNode α β} {k : α} : WellFormed cmp n → n' = erase cmp k n → WellFormed cmp n'
goal: Lean.RBNode.WellFormed cmp n → n' = Lean.RBNode.erase cmp k n → Lean.RBNode.WellFormed cmp n'

full_name: Lean.RBNode.WellFormed.leafWff
code: inductive WellFormed (cmp : α → α → Ordering) : RBNode α β → Prop where
  | leafWff : WellFormed cmp leaf
  | insertWff {n n' : RBNode α β} {k : α} {v : β k} : WellFormed cmp n → n' = insert cmp n k v → WellFormed cmp n'
  | eraseWff {n n' : RBNode α β} {k : α} : WellFormed cmp n → n' = erase cmp k n → WellFormed cmp n'
goal: Lean.RBNode.WellFormed cmp Lean.RBNode.leaf

full_name: Lean.RBNode.mapM
code: @[specialize] def mapM {α : Type v} {β γ : α → Type v} {M : Type v → Type v} [Applicative M]
  (f : (a : α) → β a → M (γ a))
  : RBNode α β → M (RBNode α γ)
  
goal: Lean.RBNode α β → M (Lean.RBNode α γ)

full_name: Lean.RBNode.map
code: @[specialize] def map {α : Type u} {β γ : α → Type v}
  (f : (a : α) → β a → γ a)
  : RBNode α β → RBNode α γ
  
goal: Lean.RBNode α β → Lean.RBNode α γ

full_name: Lean.RBNode.toArray
code: def toArray (n : RBNode α β) : Array (Sigma β) 
goal: Array (Sigma β)

full_name: Lean.RBNode.instEmptyCollection
code: instance : EmptyCollection (RBNode α β) 
goal: EmptyCollection (Lean.RBNode α β)

full_name: Lean.RBMap
code: def RBMap (α : Type u) (β : Type v) (cmp : α → α → Ordering) : Type (max u v) 
goal: Type (max u v)

full_name: Lean.mkRBMap
code: @[inline] def mkRBMap (α : Type u) (β : Type v) (cmp : α → α → Ordering) : RBMap α β cmp 
goal: Lean.RBMap α β cmp

full_name: Lean.RBMap.empty
code: @[inline] def RBMap.empty {α : Type u} {β : Type v} {cmp : α → α → Ordering} : RBMap α β cmp 
goal: Lean.RBMap α β cmp

full_name: Lean.instEmptyCollectionRBMap
code: instance (α : Type u) (β : Type v) (cmp : α → α → Ordering) : EmptyCollection (RBMap α β cmp) 
goal: EmptyCollection (Lean.RBMap α β cmp)

full_name: Lean.instInhabitedRBMap
code: instance (α : Type u) (β : Type v) (cmp : α → α → Ordering) : Inhabited (RBMap α β cmp) 
goal: Inhabited (Lean.RBMap α β cmp)

full_name: Lean.RBMap.depth
code: def depth (f : Nat → Nat → Nat) (t : RBMap α β cmp) : Nat 
goal: Nat

full_name: Lean.RBMap.fold
code: @[inline] def fold (f : σ → α → β → σ) : (init : σ) → RBMap α β cmp → σ
  
goal: Lean.RBMap α β cmp → σ

full_name: Lean.RBMap.revFold
code: @[inline] def revFold (f : σ → α → β → σ) : (init : σ) → RBMap α β cmp → σ
  
goal: Lean.RBMap α β cmp → σ

full_name: Lean.RBMap.foldM
code: @[inline] def foldM [Monad m] (f : σ → α → β → m σ) : (init : σ) → RBMap α β cmp → m σ
  
goal: Lean.RBMap α β cmp → m σ

full_name: Lean.RBMap.forM
code: @[inline] def forM [Monad m] (f : α → β → m PUnit) (t : RBMap α β cmp) : m PUnit 
goal: m PUnit

full_name: Lean.RBMap.forIn
code: @[inline] protected def forIn [Monad m] (t : RBMap α β cmp) (init : σ) (f : (α × β) → σ → m (ForInStep σ)) : m σ 
goal: m σ

full_name: Lean.RBMap.instForInProd
code: instance : ForIn m (RBMap α β cmp) (α × β) 
goal: ForIn m (Lean.RBMap α β cmp) (α × β)

full_name: Lean.RBMap.isEmpty
code: @[inline] def isEmpty : RBMap α β cmp → Bool
  
goal: Lean.RBMap α β cmp → Bool

full_name: Lean.RBMap.toList
code: @[specialize] def toList : RBMap α β cmp → List (α × β)
  
goal: Lean.RBMap α β cmp → List (α × β)

full_name: Lean.RBMap.min
code: /-- Returns the kv pair `(a,b)` such that `a ≤ k` for all keys in the RBMap. -/
@[inline] protected def min : RBMap α β cmp → Option (α × β)
  
goal: Lean.RBMap α β cmp → Option (α × β)

full_name: Lean.RBMap.max
code: /-- Returns the kv pair `(a,b)` such that `a ≥ k` for all keys in the RBMap. -/
@[inline] protected def max : RBMap α β cmp → Option (α × β)
  
goal: Lean.RBMap α β cmp → Option (α × β)

full_name: Lean.RBMap.instRepr
code: instance [Repr α] [Repr β] : Repr (RBMap α β cmp) 
goal: Repr (Lean.RBMap α β cmp)

full_name: Lean.RBMap.insert
code: @[inline] def insert : RBMap α β cmp → α → β → RBMap α β cmp
  
goal: Lean.RBMap α β cmp → α → β → Lean.RBMap α β cmp

full_name: Lean.RBMap.erase
code: @[inline] def erase : RBMap α β cmp → α → RBMap α β cmp
  
goal: Lean.RBMap α β cmp → α → Lean.RBMap α β cmp

full_name: Lean.RBMap.ofList
code: @[specialize] def ofList : List (α × β) → RBMap α β cmp
  
goal: List (α × β) → Lean.RBMap α β cmp

full_name: Lean.RBMap.findCore?
code: @[inline] def findCore? : RBMap α β cmp → α → Option (Sigma (fun (_ : α) => β))
  
goal: Lean.RBMap α β cmp → α → Option ((_ : α) × β)

full_name: Lean.RBMap.find?
code: @[inline] def find? : RBMap α β cmp → α → Option β
  
goal: Lean.RBMap α β cmp → α → Option β

full_name: Lean.RBMap.findD
code: @[inline] def findD (t : RBMap α β cmp) (k : α) (v₀ : β) : β 
goal: β

full_name: Lean.RBMap.lowerBound
code: /-- (lowerBound k) retrieves the kv pair of the largest key smaller than or equal to `k`,
    if it exists. -/
@[inline] def lowerBound : RBMap α β cmp → α → Option (Sigma (fun (_ : α) => β))
  
goal: Lean.RBMap α β cmp → α → Option ((_ : α) × β)

full_name: Lean.RBMap.contains
code: /-- Returns true if the given key `a` is in the RBMap. -/
@[inline] def contains (t : RBMap α β cmp) (a : α) : Bool 
goal: Bool

full_name: Lean.RBMap.fromList
code: @[inline] def fromList (l : List (α × β)) (cmp : α → α → Ordering) : RBMap α β cmp 
goal: Lean.RBMap α β cmp

full_name: Lean.RBMap.fromArray
code: @[inline] def fromArray (l : Array (α × β)) (cmp : α → α → Ordering) : RBMap α β cmp 
goal: Lean.RBMap α β cmp

full_name: Lean.RBMap.all
code: /-- Returns true if the given predicate is true for all items in the RBMap. -/
@[inline] def all : RBMap α β cmp → (α → β → Bool) → Bool
  
goal: Lean.RBMap α β cmp → (α → β → Bool) → Bool

full_name: Lean.RBMap.any
code: /-- Returns true if the given predicate is true for any item in the RBMap. -/
@[inline] def any : RBMap α β cmp → (α → β → Bool) → Bool
  
goal: Lean.RBMap α β cmp → (α → β → Bool) → Bool

full_name: Lean.RBMap.size
code: /-- The number of items in the RBMap. -/
def size (m : RBMap α β cmp) : Nat 
goal: Nat

full_name: Lean.RBMap.maxDepth
code: def maxDepth (t : RBMap α β cmp) : Nat 
goal: Nat

full_name: Lean.RBMap.min!
code: @[inline] def min! [Inhabited α] [Inhabited β] (t : RBMap α β cmp) : α × β 
goal: α × β

full_name: Lean.RBMap.max!
code: @[inline] def max! [Inhabited α] [Inhabited β] (t : RBMap α β cmp) : α × β 
goal: α × β

full_name: Lean.RBMap.find!
code: /-- Attempts to find the value with key `k : α` in `t` and panics if there is no such key. -/
@[inline] def find! [Inhabited β] (t : RBMap α β cmp) (k : α) : β 
goal: β

full_name: Lean.RBMap.mergeBy
code: /-- 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. -/
def mergeBy (mergeFn : α → β → β → β) (t₁ t₂ : RBMap α β cmp) : RBMap α β cmp 
goal: Lean.RBMap α β cmp

full_name: Lean.RBMap.intersectBy
code: /-- Intersects the maps `t₁` and `t₂` using `mergeFn a b₁ b₂` to produce the new value. -/
def intersectBy {γ : Type v₁} {δ : Type v₂} (mergeFn : α → β → γ → δ) (t₁ : RBMap α β cmp) (t₂ : RBMap α γ cmp) : RBMap α δ cmp 
goal: Lean.RBMap α δ cmp

full_name: Lean.rbmapOf
code: def rbmapOf {α : Type u} {β : Type v} (l : List (α × β)) (cmp : α → α → Ordering) : RBMap α β cmp 
goal: Lean.RBMap α β cmp