pith. machine review for the scientific record. sign in
def definition def or abbrev

previewNatArray

show as:
view Lean formalization →

No prose has been written for this declaration yet. The Lean source and graph data below render without it.

generate prose now

formal statement (Lean)

  44def previewNatArray (arr : Array Nat) (limit : Nat := 4) : String :=

proof body

Definition body.

  45  let previewVals := (arr.toList.take limit).map (fun n => toString n)
  46  let body := String.intercalate ", " previewVals
  47  if previewVals.isEmpty then "[]"
  48  else
  49    let ellipsis := if arr.size > previewVals.length then ", …" else ""
  50    "[" ++ body ++ ellipsis ++ "]"
  51

used by (1)

From the project-wide theorem graph. These declarations reference this one in their body.

depends on (2)

Lean names referenced from this declaration's body.