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

full_name: Lean.HashMapBucket
code: def HashMapBucket (α : Type u) (β : Type v) 
goal: Type (max 0 u v)

full_name: Lean.HashMapBucket.update
code: def HashMapBucket.update {α : Type u} {β : Type v} (data : HashMapBucket α β) (i : USize) (d : AssocList α β) (h : i.toNat < data.val.size) : HashMapBucket α β 
goal: Lean.HashMapBucket α β

full_name: Lean.HashMapBucket.size_update
code: @[simp] theorem HashMapBucket.size_update {α : Type u} {β : Type v} (data : HashMapBucket α β) (i : USize) (d : AssocList α β)
    (h : i.toNat < data.val.size) : (data.update i d h).val.size = data.val.size 
goal: (data.update i d h).val.size = data.val.size

full_name: Lean.HashMapImp.size
code: structure HashMapImp (α : Type u) (β : Type v) where
  size       : Nat
  buckets    : HashMapBucket α β
goal: Nat

full_name: Lean.HashMapImp.buckets
code: structure HashMapImp (α : Type u) (β : Type v) where
  size       : Nat
  buckets    : HashMapBucket α β
goal: Lean.HashMapBucket α β

full_name: Lean.HashMapImp
code: structure HashMapImp (α : Type u) (β : Type v) where
  size       : Nat
  buckets    : HashMapBucket α β
goal: Type (max u v)

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Data.HashMap.0.Lean.numBucketsForCapacity
code: private def numBucketsForCapacity (capacity : Nat) : Nat 
goal: Nat

full_name: Lean.mkHashMapImp
code: def mkHashMapImp {α : Type u} {β : Type v} (capacity := 8) : HashMapImp α β 
goal: Lean.HashMapImp α β

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Data.HashMap.0.Lean.HashMapImp.mkIdx
code: @[extern "lean_hashmap_mk_idx"]
private def mkIdx {sz : Nat} (hash : UInt64) (h : sz.isPowerOfTwo) : { u : USize // u.toNat < sz } 
goal: { u // u.toNat < sz }

full_name: Lean.HashMapImp.reinsertAux
code: @[inline] def reinsertAux (hashFn : α → UInt64) (data : HashMapBucket α β) (a : α) (b : β) : HashMapBucket α β 
goal: Lean.HashMapBucket α β

full_name: Lean.HashMapImp.foldBucketsM
code: @[inline] def foldBucketsM {δ : Type w} {m : Type w → Type w} [Monad m] (data : HashMapBucket α β) (d : δ) (f : δ → α → β → m δ) : m δ 
goal: m δ

full_name: Lean.HashMapImp.foldBuckets
code: @[inline] def foldBuckets {δ : Type w} (data : HashMapBucket α β) (d : δ) (f : δ → α → β → δ) : δ 
goal: δ

full_name: Lean.HashMapImp.foldM
code: @[inline] def foldM {δ : Type w} {m : Type w → Type w} [Monad m] (f : δ → α → β → m δ) (d : δ) (h : HashMapImp α β) : m δ 
goal: m δ

full_name: Lean.HashMapImp.fold
code: @[inline] def fold {δ : Type w} (f : δ → α → β → δ) (d : δ) (m : HashMapImp α β) : δ 
goal: δ

full_name: Lean.HashMapImp.forBucketsM
code: @[inline] def forBucketsM {m : Type w → Type w} [Monad m] (data : HashMapBucket α β) (f : α → β → m PUnit) : m PUnit 
goal: m PUnit

full_name: Lean.HashMapImp.forM
code: @[inline] def forM {m : Type w → Type w} [Monad m] (f : α → β → m PUnit) (h : HashMapImp α β) : m PUnit 
goal: m PUnit

full_name: Lean.HashMapImp.findEntry?
code: def findEntry? [BEq α] [Hashable α] (m : HashMapImp α β) (a : α) : Option (α × β) 
goal: Option (α × β)

full_name: Lean.HashMapImp.find?
code: def find? [beq : BEq α] [Hashable α] (m : HashMapImp α β) (a : α) : Option β 
goal: Option β

full_name: Lean.HashMapImp.contains
code: def contains [BEq α] [Hashable α] (m : HashMapImp α β) (a : α) : Bool 
goal: Bool

full_name: Lean.HashMapImp.moveEntries
code: def moveEntries [Hashable α] (i : Nat) (source : Array (AssocList α β)) (target : HashMapBucket α β) : HashMapBucket α β 
goal: Lean.HashMapBucket α β

full_name: Lean.HashMapImp.expand
code: def expand [Hashable α] (size : Nat) (buckets : HashMapBucket α β) : HashMapImp α β 
goal: Lean.HashMapImp α β

full_name: Lean.HashMapImp.insert
code: @[inline] def insert [beq : BEq α] [Hashable α] (m : HashMapImp α β) (a : α) (b : β) : HashMapImp α β × Bool 
goal: Lean.HashMapImp α β × Bool

full_name: Lean.HashMapImp.insertIfNew
code: @[inline] def insertIfNew [beq : BEq α] [Hashable α] (m : HashMapImp α β) (a : α) (b : β) : HashMapImp α β × Option β 
goal: Lean.HashMapImp α β × Option β

full_name: Lean.HashMapImp.erase
code: def erase [BEq α] [Hashable α] (m : HashMapImp α β) (a : α) : HashMapImp α β 
goal: Lean.HashMapImp α β

full_name: Lean.HashMapImp.WellFormed.mkWff
code: inductive WellFormed [BEq α] [Hashable α] : HashMapImp α β → Prop where
  | mkWff          : ∀ n,                    WellFormed (mkHashMapImp n)
  | insertWff      : ∀ m a b, WellFormed m → WellFormed (insert m a b |>.1)
  | insertIfNewWff : ∀ m a b, WellFormed m → WellFormed (insertIfNew m a b |>.1)
  | eraseWff       : ∀ m a,   WellFormed m → WellFormed (erase m a)
goal: (Lean.mkHashMapImp n).WellFormed

full_name: Lean.HashMapImp.WellFormed.eraseWff
code: inductive WellFormed [BEq α] [Hashable α] : HashMapImp α β → Prop where
  | mkWff          : ∀ n,                    WellFormed (mkHashMapImp n)
  | insertWff      : ∀ m a b, WellFormed m → WellFormed (insert m a b |>.1)
  | insertIfNewWff : ∀ m a b, WellFormed m → WellFormed (insertIfNew m a b |>.1)
  | eraseWff       : ∀ m a,   WellFormed m → WellFormed (erase m a)
goal: m.WellFormed → (m.erase a).WellFormed

full_name: Lean.HashMapImp.WellFormed.insertWff
code: inductive WellFormed [BEq α] [Hashable α] : HashMapImp α β → Prop where
  | mkWff          : ∀ n,                    WellFormed (mkHashMapImp n)
  | insertWff      : ∀ m a b, WellFormed m → WellFormed (insert m a b |>.1)
  | insertIfNewWff : ∀ m a b, WellFormed m → WellFormed (insertIfNew m a b |>.1)
  | eraseWff       : ∀ m a,   WellFormed m → WellFormed (erase m a)
goal: m.WellFormed → (m.insert a b).fst.WellFormed

full_name: Lean.HashMapImp.WellFormed
code: inductive WellFormed [BEq α] [Hashable α] : HashMapImp α β → Prop where
  | mkWff          : ∀ n,                    WellFormed (mkHashMapImp n)
  | insertWff      : ∀ m a b, WellFormed m → WellFormed (insert m a b |>.1)
  | insertIfNewWff : ∀ m a b, WellFormed m → WellFormed (insertIfNew m a b |>.1)
  | eraseWff       : ∀ m a,   WellFormed m → WellFormed (erase m a)
goal: Lean.HashMapImp α β → Prop

full_name: Lean.HashMapImp.WellFormed.insertIfNewWff
code: inductive WellFormed [BEq α] [Hashable α] : HashMapImp α β → Prop where
  | mkWff          : ∀ n,                    WellFormed (mkHashMapImp n)
  | insertWff      : ∀ m a b, WellFormed m → WellFormed (insert m a b |>.1)
  | insertIfNewWff : ∀ m a b, WellFormed m → WellFormed (insertIfNew m a b |>.1)
  | eraseWff       : ∀ m a,   WellFormed m → WellFormed (erase m a)
goal: m.WellFormed → (m.insertIfNew a b).fst.WellFormed

full_name: Lean.HashMap
code: def HashMap (α : Type u) (β : Type v) [BEq α] [Hashable α] 
goal: Type (max 0 u v)

full_name: Lean.mkHashMap
code: def mkHashMap {α : Type u} {β : Type v} [BEq α] [Hashable α] (capacity := 8) : HashMap α β 
goal: Lean.HashMap α β

full_name: Lean.HashMap.instInhabited
code: instance [BEq α] [Hashable α] : Inhabited (HashMap α β) 
goal: Inhabited (Lean.HashMap α β)

full_name: Lean.HashMap.instEmptyCollection
code: instance [BEq α] [Hashable α] : EmptyCollection (HashMap α β) 
goal: EmptyCollection (Lean.HashMap α β)

full_name: Lean.HashMap.empty
code: @[inline] def empty [BEq α] [Hashable α] : HashMap α β 
goal: Lean.HashMap α β

full_name: Lean.HashMap.insert
code: def insert (m : HashMap α β) (a : α) (b : β) : HashMap α β 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → α → β → Lean.HashMap α β

full_name: Lean.HashMap.insert'
code: /-- Similar to `insert`, but also returns a Boolean flag indicating whether an existing entry has been replaced with `a -> b`. -/
def insert' (m : HashMap α β) (a : α) (b : β) : HashMap α β × Bool 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → α → β → Lean.HashMap α β × Bool

full_name: Lean.HashMap.insertIfNew
code: /--
Similar to `insert`, but returns `some old` if the map already had an entry `α → old`.
If the result is `some old`, the the resulting map is equal to `m`. -/
def insertIfNew (m : HashMap α β) (a : α) (b : β) : HashMap α β × Option β 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → α → β → Lean.HashMap α β × Option β

full_name: Lean.HashMap.erase
code: @[inline] def erase (m : HashMap α β) (a : α) : HashMap α β 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → α → Lean.HashMap α β

full_name: Lean.HashMap.findEntry?
code: @[inline] def findEntry? (m : HashMap α β) (a : α) : Option (α × β) 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → α → Option (α × β)

full_name: Lean.HashMap.find?
code: @[inline] def find? (m : HashMap α β) (a : α) : Option β 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → α → Option β

full_name: Lean.HashMap.findD
code: @[inline] def findD (m : HashMap α β) (a : α) (b₀ : β) : β 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → α → β → β

full_name: Lean.HashMap.find!
code: @[inline] def find! [Inhabited β] (m : HashMap α β) (a : α) : β 
goal: {x : BEq α} → {x_1 : Hashable α} → [inst : Inhabited β] → Lean.HashMap α β → α → β

full_name: Lean.HashMap.instGetElemOptionTrue
code: instance : GetElem (HashMap α β) α (Option β) fun _ _ => True 
goal: {x : BEq α} → {x_1 : Hashable α} → GetElem (Lean.HashMap α β) α (Option β) fun x x => True

full_name: Lean.HashMap.contains
code: @[inline] def contains (m : HashMap α β) (a : α) : Bool 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → α → Bool

full_name: Lean.HashMap.foldM
code: @[inline] def foldM {δ : Type w} {m : Type w → Type w} [Monad m] (f : δ → α → β → m δ) (init : δ) (h : HashMap α β) : m δ 
goal: {x : BEq α} →
  {x_1 : Hashable α} →
    {δ : Type w} → {m : Type w → Type w} → [inst : Monad m] → (δ → α → β → m δ) → δ → Lean.HashMap α β → m δ

full_name: Lean.HashMap.fold
code: @[inline] def fold {δ : Type w} (f : δ → α → β → δ) (init : δ) (m : HashMap α β) : δ 
goal: {x : BEq α} → {x_1 : Hashable α} → {δ : Type w} → (δ → α → β → δ) → δ → Lean.HashMap α β → δ

full_name: Lean.HashMap.forM
code: @[inline] def forM {m : Type w → Type w} [Monad m] (f : α → β → m PUnit) (h : HashMap α β) : m PUnit 
goal: {x : BEq α} →
  {x_1 : Hashable α} → {m : Type w → Type w} → [inst : Monad m] → (α → β → m PUnit) → Lean.HashMap α β → m PUnit

full_name: Lean.HashMap.size
code: @[inline] def size (m : HashMap α β) : Nat 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → Nat

full_name: Lean.HashMap.isEmpty
code: @[inline] def isEmpty (m : HashMap α β) : Bool 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → Bool

full_name: Lean.HashMap.toList
code: def toList (m : HashMap α β) : List (α × β) 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → List (α × β)

full_name: Lean.HashMap.toArray
code: def toArray (m : HashMap α β) : Array (α × β) 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → Array (α × β)

full_name: Lean.HashMap.numBuckets
code: def numBuckets (m : HashMap α β) : Nat 
goal: {x : BEq α} → {x_1 : Hashable α} → Lean.HashMap α β → Nat

full_name: Lean.HashMap.ofList
code: /-- Builds a `HashMap` from a list of key-value pairs. Values of duplicated keys are replaced by their respective last occurrences. -/
def ofList (l : List (α × β)) : HashMap α β 
goal: Lean.HashMap α β

full_name: Lean.HashMap.ofListWith
code: /-- Variant of `ofList` which accepts a function that combines values of duplicated keys. -/
def ofListWith (l : List (α × β)) (f : β → β → β) : HashMap α β 
goal: Lean.HashMap α β

full_name: Array.groupByKey
code: /--
Groups all elements `x`, `y` in `xs` with `key x == key y` into the same array
`(xs.groupByKey key).find! (key x)`. Groups preserve the relative order of elements in `xs`.
-/
def Array.groupByKey [BEq α] [Hashable α] (key : β → α) (xs : Array β)
    : Lean.HashMap α (Array β) 
goal: Lean.HashMap α (Array β)