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

full_name: Lean.instInhabitedPersistentArrayNode
code: inductive PersistentArrayNode (α : Type u) where
  | node (cs : Array (PersistentArrayNode α)) : PersistentArrayNode α
  | leaf (vs : Array α)                       : PersistentArrayNode α
  deriving Inhabited
goal: {a : Type u_1} → Inhabited (Lean.PersistentArrayNode a)

full_name: Lean.PersistentArrayNode.node
code: inductive PersistentArrayNode (α : Type u) where
  | node (cs : Array (PersistentArrayNode α)) : PersistentArrayNode α
  | leaf (vs : Array α)                       : PersistentArrayNode α
  deriving Inhabited
goal: Lean.PersistentArrayNode α

full_name: Lean.PersistentArrayNode
code: inductive PersistentArrayNode (α : Type u) where
  | node (cs : Array (PersistentArrayNode α)) : PersistentArrayNode α
  | leaf (vs : Array α)                       : PersistentArrayNode α
  deriving Inhabited
goal: Type u

full_name: Lean.PersistentArrayNode.leaf
code: inductive PersistentArrayNode (α : Type u) where
  | node (cs : Array (PersistentArrayNode α)) : PersistentArrayNode α
  | leaf (vs : Array α)                       : PersistentArrayNode α
  deriving Inhabited
goal: Lean.PersistentArrayNode α

full_name: Lean.PersistentArrayNode.isNode
code: def isNode {α} : PersistentArrayNode α → Bool
  
goal: Lean.PersistentArrayNode α → Bool

full_name: Lean.PersistentArray.initShift
code: abbrev PersistentArray.initShift : USize 
goal: USize

full_name: Lean.PersistentArray.branching
code: abbrev PersistentArray.branching : USize 
goal: USize

full_name: Lean.PersistentArray.size
code: structure PersistentArray (α : Type u) where
  /- Recall that we run out of memory if we have more than `usizeSz/8` elements.
     So, we can stop adding elements at `root` after `size > usizeSz`, and
     keep growing the `tail`. This modification allow us to use `USize` instead
     of `Nat` when traversing `root`. -/
  root    : PersistentArrayNode α := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat)
  tail    : Array α               := Array.mkEmpty PersistentArray.branching.toNat
  size    : Nat                   := 0
  shift   : USize                 := PersistentArray.initShift
  tailOff : Nat                   := 0
  deriving Inhabited
goal: Nat

full_name: Lean.PersistentArray.root
code: structure PersistentArray (α : Type u) where
  /- Recall that we run out of memory if we have more than `usizeSz/8` elements.
     So, we can stop adding elements at `root` after `size > usizeSz`, and
     keep growing the `tail`. This modification allow us to use `USize` instead
     of `Nat` when traversing `root`. -/
  root    : PersistentArrayNode α := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat)
  tail    : Array α               := Array.mkEmpty PersistentArray.branching.toNat
  size    : Nat                   := 0
  shift   : USize                 := PersistentArray.initShift
  tailOff : Nat                   := 0
  deriving Inhabited
goal: Lean.PersistentArrayNode α

full_name: Lean.PersistentArray.shift
code: structure PersistentArray (α : Type u) where
  /- Recall that we run out of memory if we have more than `usizeSz/8` elements.
     So, we can stop adding elements at `root` after `size > usizeSz`, and
     keep growing the `tail`. This modification allow us to use `USize` instead
     of `Nat` when traversing `root`. -/
  root    : PersistentArrayNode α := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat)
  tail    : Array α               := Array.mkEmpty PersistentArray.branching.toNat
  size    : Nat                   := 0
  shift   : USize                 := PersistentArray.initShift
  tailOff : Nat                   := 0
  deriving Inhabited
goal: USize

full_name: Lean.instInhabitedPersistentArray
code: structure PersistentArray (α : Type u) where
  /- Recall that we run out of memory if we have more than `usizeSz/8` elements.
     So, we can stop adding elements at `root` after `size > usizeSz`, and
     keep growing the `tail`. This modification allow us to use `USize` instead
     of `Nat` when traversing `root`. -/
  root    : PersistentArrayNode α := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat)
  tail    : Array α               := Array.mkEmpty PersistentArray.branching.toNat
  size    : Nat                   := 0
  shift   : USize                 := PersistentArray.initShift
  tailOff : Nat                   := 0
  deriving Inhabited
goal: {a : Type u_1} → Inhabited (Lean.PersistentArray a)

full_name: Lean.PersistentArray.tail
code: structure PersistentArray (α : Type u) where
  /- Recall that we run out of memory if we have more than `usizeSz/8` elements.
     So, we can stop adding elements at `root` after `size > usizeSz`, and
     keep growing the `tail`. This modification allow us to use `USize` instead
     of `Nat` when traversing `root`. -/
  root    : PersistentArrayNode α := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat)
  tail    : Array α               := Array.mkEmpty PersistentArray.branching.toNat
  size    : Nat                   := 0
  shift   : USize                 := PersistentArray.initShift
  tailOff : Nat                   := 0
  deriving Inhabited
goal: Array α

full_name: Lean.PersistentArray.tailOff
code: structure PersistentArray (α : Type u) where
  /- Recall that we run out of memory if we have more than `usizeSz/8` elements.
     So, we can stop adding elements at `root` after `size > usizeSz`, and
     keep growing the `tail`. This modification allow us to use `USize` instead
     of `Nat` when traversing `root`. -/
  root    : PersistentArrayNode α := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat)
  tail    : Array α               := Array.mkEmpty PersistentArray.branching.toNat
  size    : Nat                   := 0
  shift   : USize                 := PersistentArray.initShift
  tailOff : Nat                   := 0
  deriving Inhabited
goal: Nat

full_name: Lean.PersistentArray
code: structure PersistentArray (α : Type u) where
  /- Recall that we run out of memory if we have more than `usizeSz/8` elements.
     So, we can stop adding elements at `root` after `size > usizeSz`, and
     keep growing the `tail`. This modification allow us to use `USize` instead
     of `Nat` when traversing `root`. -/
  root    : PersistentArrayNode α := PersistentArrayNode.node (Array.mkEmpty PersistentArray.branching.toNat)
  tail    : Array α               := Array.mkEmpty PersistentArray.branching.toNat
  size    : Nat                   := 0
  shift   : USize                 := PersistentArray.initShift
  tailOff : Nat                   := 0
  deriving Inhabited
goal: Type u

full_name: Lean.PArray
code: abbrev PArray (α : Type u) 
goal: Type u

full_name: Lean.PersistentArray.empty
code: def empty : PersistentArray α 
goal: Lean.PersistentArray α

full_name: Lean.PersistentArray.isEmpty
code: def isEmpty (a : PersistentArray α) : Bool 
goal: Bool

full_name: Lean.PersistentArray.mkEmptyArray
code: def mkEmptyArray : Array α 
goal: Array α

full_name: Lean.PersistentArray.mul2Shift
code: abbrev mul2Shift (i : USize) (shift : USize) : USize 
goal: USize

full_name: Lean.PersistentArray.div2Shift
code: abbrev div2Shift (i : USize) (shift : USize) : USize 
goal: USize

full_name: Lean.PersistentArray.mod2Shift
code: abbrev mod2Shift (i : USize) (shift : USize) : USize 
goal: USize

full_name: Lean.PersistentArray.getAux
code: partial def getAux [Inhabited α] : PersistentArrayNode α → USize → USize → α
  
goal: Lean.PersistentArrayNode α → USize → USize → α

full_name: Lean.PersistentArray.get!
code: def get! [Inhabited α] (t : PersistentArray α) (i : Nat) : α 
goal: α

full_name: Lean.PersistentArray.instGetElemNatLtSizeOfInhabited
code: instance [Inhabited α] : GetElem (PersistentArray α) Nat α fun as i => i < as.size 
goal: GetElem (Lean.PersistentArray α) Nat α fun as i => i < as.size

full_name: Lean.PersistentArray.setAux
code: partial def setAux : PersistentArrayNode α → USize → USize → α → PersistentArrayNode α
  
goal: Lean.PersistentArrayNode α → USize → USize → α → Lean.PersistentArrayNode α

full_name: Lean.PersistentArray.set
code: def set (t : PersistentArray α) (i : Nat) (a : α) : PersistentArray α 
goal: Lean.PersistentArray α

full_name: Lean.PersistentArray.modifyAux
code: @[specialize] partial def modifyAux [Inhabited α] (f : α → α) : PersistentArrayNode α → USize → USize → PersistentArrayNode α
  
goal: Lean.PersistentArrayNode α → USize → USize → Lean.PersistentArrayNode α

full_name: Lean.PersistentArray.modify
code: @[specialize] def modify [Inhabited α] (t : PersistentArray α) (i : Nat) (f : α → α) : PersistentArray α 
goal: Lean.PersistentArray α

full_name: Lean.PersistentArray.mkNewPath
code: partial def mkNewPath (shift : USize) (a : Array α) : PersistentArrayNode α 
goal: Lean.PersistentArrayNode α

full_name: Lean.PersistentArray.insertNewLeaf
code: partial def insertNewLeaf : PersistentArrayNode α → USize → USize → Array α → PersistentArrayNode α
  
goal: Lean.PersistentArrayNode α → USize → USize → Array α → Lean.PersistentArrayNode α

full_name: Lean.PersistentArray.mkNewTail
code: def mkNewTail (t : PersistentArray α) : PersistentArray α 
goal: Lean.PersistentArray α

full_name: Lean.PersistentArray.tooBig
code: def tooBig : Nat 
goal: Nat

full_name: Lean.PersistentArray.push
code: def push (t : PersistentArray α) (a : α) : PersistentArray α 
goal: Lean.PersistentArray α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Data.PersistentArray.0.Lean.PersistentArray.emptyArray
code: private def emptyArray {α : Type u} : Array (PersistentArrayNode α) 
goal: Array (Lean.PersistentArrayNode α)

full_name: Lean.PersistentArray.popLeaf
code: partial def popLeaf : PersistentArrayNode α → Option (Array α) × Array (PersistentArrayNode α)
  
goal: Lean.PersistentArrayNode α → Option (Array α) × Array (Lean.PersistentArrayNode α)

full_name: Lean.PersistentArray.pop
code: def pop (t : PersistentArray α) : PersistentArray α 
goal: Lean.PersistentArray α

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Data.PersistentArray.0.Lean.PersistentArray.foldlMAux
code: @[specialize] private partial def foldlMAux (f : β → α → m β) : PersistentArrayNode α → β → m β
  
goal: Lean.PersistentArrayNode α → β → m β

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Data.PersistentArray.0.Lean.PersistentArray.foldlFromMAux
code: @[specialize] private partial def foldlFromMAux (f : β → α → m β) : PersistentArrayNode α → USize → USize → β → m β
  
goal: Lean.PersistentArrayNode α → USize → USize → β → m β

full_name: Lean.PersistentArray.foldlM
code: @[specialize] def foldlM (t : PersistentArray α) (f : β → α → m β) (init : β) (start : Nat := 0) : m β 
goal: m β

full_name: _private.«.lake».packages.lean4.src.lean.Lean.Data.PersistentArray.0.Lean.PersistentArray.foldrMAux
code: @[specialize] private partial def foldrMAux [Monad m] (f : α → β → m β) : PersistentArrayNode α → β → m β
  
goal: Lean.PersistentArrayNode α → β → m β

full_name: Lean.PersistentArray.foldrM
code: @[specialize] def foldrM [Monad m] (t : PersistentArray α) (f : α → β → m β) (init : β) : m β 
goal: m β

full_name: Lean.PersistentArray.forInAux
code: @[specialize]
partial def forInAux {α : Type u} {β : Type v} {m : Type v → Type w} [Monad m] [inh : Inhabited β]
    (f : α → β → m (ForInStep β)) (n : PersistentArrayNode α) (b : β) : m (ForInStep β) 
goal: m (ForInStep β)

full_name: Lean.PersistentArray.forIn
code: @[specialize] protected def forIn (t : PersistentArray α) (init : β) (f : α → β → m (ForInStep β)) : m β 
goal: m β

full_name: Lean.PersistentArray.instForIn
code: instance : ForIn m (PersistentArray α) α 
goal: ForIn m (Lean.PersistentArray α) α

full_name: Lean.PersistentArray.findSomeMAux
code: @[specialize] partial def findSomeMAux (f : α → m (Option β)) : PersistentArrayNode α → m (Option β)
  
goal: Lean.PersistentArrayNode α → m (Option β)

full_name: Lean.PersistentArray.findSomeM?
code: @[specialize] def findSomeM? (t : PersistentArray α) (f : α → m (Option β)) : m (Option β) 
goal: m (Option β)

full_name: Lean.PersistentArray.findSomeRevMAux
code: @[specialize] partial def findSomeRevMAux (f : α → m (Option β)) : PersistentArrayNode α → m (Option β)
  
goal: Lean.PersistentArrayNode α → m (Option β)

full_name: Lean.PersistentArray.findSomeRevM?
code: @[specialize] def findSomeRevM? (t : PersistentArray α) (f : α → m (Option β)) : m (Option β) 
goal: m (Option β)

full_name: Lean.PersistentArray.forMAux
code: @[specialize] partial def forMAux (f : α → m PUnit) : PersistentArrayNode α → m PUnit
  
goal: Lean.PersistentArrayNode α → m PUnit

full_name: Lean.PersistentArray.forM
code: @[specialize] def forM (t : PersistentArray α) (f : α → m PUnit) : m PUnit 
goal: m PUnit

full_name: Lean.PersistentArray.foldl
code: @[inline] def foldl (t : PersistentArray α) (f : β → α → β) (init : β) (start : Nat := 0) : β 
goal: β

full_name: Lean.PersistentArray.foldr
code: @[inline] def foldr (t : PersistentArray α) (f : α → β → β) (init : β) : β 
goal: β

full_name: Lean.PersistentArray.filter
code: @[inline] def filter (as : PersistentArray α) (p : α → Bool) : PersistentArray α 
goal: Lean.PersistentArray α

full_name: Lean.PersistentArray.toArray
code: def toArray (t : PersistentArray α) : Array α 
goal: Array α

full_name: Lean.PersistentArray.append
code: def append (t₁ t₂ : PersistentArray α) : PersistentArray α 
goal: Lean.PersistentArray α

full_name: Lean.PersistentArray.instAppend
code: instance : Append (PersistentArray α) 
goal: Append (Lean.PersistentArray α)

full_name: Lean.PersistentArray.findSome?
code: @[inline] def findSome? {β} (t : PersistentArray α) (f : α → (Option β)) : Option β 
goal: Option β

full_name: Lean.PersistentArray.findSomeRev?
code: @[inline] def findSomeRev? {β} (t : PersistentArray α) (f : α → (Option β)) : Option β 
goal: Option β

full_name: Lean.PersistentArray.toList
code: def toList (t : PersistentArray α) : List α 
goal: List α

full_name: Lean.PersistentArray.anyMAux
code: @[specialize] partial def anyMAux (p : α → m Bool) : PersistentArrayNode α → m Bool
  
goal: Lean.PersistentArrayNode α → m Bool

full_name: Lean.PersistentArray.anyM
code: @[specialize] def anyM (t : PersistentArray α) (p : α → m Bool) : m Bool 
goal: m Bool

full_name: Lean.PersistentArray.allM
code: @[inline] def allM (a : PersistentArray α) (p : α → m Bool) : m Bool 
goal: m Bool

full_name: Lean.PersistentArray.any
code: @[inline] def any (a : PersistentArray α) (p : α → Bool) : Bool 
goal: Bool

full_name: Lean.PersistentArray.all
code: @[inline] def all (a : PersistentArray α) (p : α → Bool) : Bool 
goal: Bool

full_name: Lean.PersistentArray.mapMAux
code: @[specialize] partial def mapMAux (f : α → m β) : PersistentArrayNode α → m (PersistentArrayNode β)
  
goal: Lean.PersistentArrayNode α → m (Lean.PersistentArrayNode β)

full_name: Lean.PersistentArray.mapM
code: @[specialize] def mapM (f : α → m β) (t : PersistentArray α) : m (PersistentArray β) 
goal: m (Lean.PersistentArray β)

full_name: Lean.PersistentArray.map
code: @[inline] def map {β} (f : α → β) (t : PersistentArray α) : PersistentArray β 
goal: Lean.PersistentArray β

full_name: Lean.PersistentArray.Stats.numNodes
code: structure Stats where
  numNodes : Nat
  depth : Nat
  tailSize : Nat
goal: Nat

full_name: Lean.PersistentArray.Stats.depth
code: structure Stats where
  numNodes : Nat
  depth : Nat
  tailSize : Nat
goal: Nat

full_name: Lean.PersistentArray.Stats.tailSize
code: structure Stats where
  numNodes : Nat
  depth : Nat
  tailSize : Nat
goal: Nat

full_name: Lean.PersistentArray.Stats
code: structure Stats where
  numNodes : Nat
  depth : Nat
  tailSize : Nat
goal: Type

full_name: Lean.PersistentArray.collectStats
code: partial def collectStats : PersistentArrayNode α → Stats → Nat → Stats
  
goal: Lean.PersistentArrayNode α → Lean.PersistentArray.Stats → Nat → Lean.PersistentArray.Stats

full_name: Lean.PersistentArray.stats
code: def stats (r : PersistentArray α) : Stats 
goal: Lean.PersistentArray.Stats

full_name: Lean.PersistentArray.Stats.toString
code: def Stats.toString (s : Stats) : String 
goal: String

full_name: Lean.PersistentArray.instToStringStats
code: instance : ToString Stats 
goal: ToString Lean.PersistentArray.Stats

full_name: Lean.mkPersistentArray
code: def mkPersistentArray {α : Type u} (n : Nat) (v : α) : PArray α 
goal: Lean.PArray α

full_name: Lean.mkPArray
code: @[inline] def mkPArray {α : Type u} (n : Nat) (v : α) : PArray α 
goal: Lean.PArray α

full_name: List.toPArray'.loop
code: def List.toPArray' {α : Type u} (xs : List α) : PersistentArray α 
goal: List α → Lean.PersistentArray α → Lean.PersistentArray α

full_name: List.toPArray'
code: def List.toPArray' {α : Type u} (xs : List α) : PersistentArray α 
goal: Lean.PersistentArray α

full_name: Array.toPArray'
code: def Array.toPArray' {α : Type u} (xs : Array α) : PersistentArray α 
goal: Lean.PersistentArray α