File: .lake/packages/aesop/Aesop/Util/UnionFind.lean

full_name: Aesop.UnionFind
code: structure UnionFind (α) [BEq α] [Hashable α] where
  parents : Array USize
  sizes : Array USize
  toRep : HashMap α USize
  -- Invariant: `toRep` contains exactly the indices of `parents` as values
  deriving Inhabited
goal: Type u_1

full_name: Aesop.instInhabitedUnionFind
code: structure UnionFind (α) [BEq α] [Hashable α] where
  parents : Array USize
  sizes : Array USize
  toRep : HashMap α USize
  -- Invariant: `toRep` contains exactly the indices of `parents` as values
  deriving Inhabited
goal: {a : Type u_1} → {a_1 : BEq a} → {a_2 : Hashable a} → Inhabited (Aesop.UnionFind a)

full_name: Aesop.UnionFind.sizes
code: structure UnionFind (α) [BEq α] [Hashable α] where
  parents : Array USize
  sizes : Array USize
  toRep : HashMap α USize
  -- Invariant: `toRep` contains exactly the indices of `parents` as values
  deriving Inhabited
goal: Array USize

full_name: Aesop.UnionFind.parents
code: structure UnionFind (α) [BEq α] [Hashable α] where
  parents : Array USize
  sizes : Array USize
  toRep : HashMap α USize
  -- Invariant: `toRep` contains exactly the indices of `parents` as values
  deriving Inhabited
goal: Array USize

full_name: Aesop.UnionFind.toRep
code: structure UnionFind (α) [BEq α] [Hashable α] where
  parents : Array USize
  sizes : Array USize
  toRep : HashMap α USize
  -- Invariant: `toRep` contains exactly the indices of `parents` as values
  deriving Inhabited
goal: Lean.HashMap α USize

full_name: Aesop.UnionFind.instEmptyCollection
code: instance : EmptyCollection (UnionFind α) 
goal: EmptyCollection (Aesop.UnionFind α)

full_name: Aesop.UnionFind.size
code: def size (u : UnionFind α) : Nat 
goal: Nat

full_name: Aesop.UnionFind.add
code: def add (x : α) (u : UnionFind α) : UnionFind α 
goal: Aesop.UnionFind α

full_name: Aesop.UnionFind.addArray
code: def addArray (xs : Array α) (u : UnionFind α) : UnionFind α 
goal: Aesop.UnionFind α

full_name: Aesop.UnionFind.ofArray
code: def ofArray (xs : Array α) : UnionFind α 
goal: Aesop.UnionFind α

full_name: _private.«.lake».packages.aesop.Aesop.Util.UnionFind.0.Aesop.UnionFind.findRepUnsafe
code: private unsafe def findRepUnsafe (i : USize) (u : UnionFind α) :
    USize × UnionFind α 
goal: USize × Aesop.UnionFind α

full_name: _private.«.lake».packages.aesop.Aesop.Util.UnionFind.0.Aesop.UnionFind.findRep
code: @[implemented_by findRepUnsafe]
private opaque findRep : USize → UnionFind α → USize × UnionFind α
goal: USize → Aesop.UnionFind α → USize × Aesop.UnionFind α

full_name: Aesop.UnionFind.find?
code: partial def find? (x : α) (u : UnionFind α) : Option USize × UnionFind α 
goal: Option USize × Aesop.UnionFind α

full_name: _private.«.lake».packages.aesop.Aesop.Util.UnionFind.0.Aesop.UnionFind.mergeUnsafe
code: private unsafe def mergeUnsafe (x y : α) (u : UnionFind α) :
    UnionFind α 
goal: Aesop.UnionFind α

full_name: Aesop.UnionFind.merge
code: @[implemented_by mergeUnsafe]
opaque merge (x y : α) : UnionFind α → UnionFind α
goal: Aesop.UnionFind α → Aesop.UnionFind α

full_name: Aesop.UnionFind.sets
code: def sets {α : Type v} [BEq α] [Hashable α] (u : UnionFind α) : Array (Array α) × UnionFind α 
goal: Array (Array α) × Aesop.UnionFind α