List.splitOn #
The original list L can be recovered by flattening the lists produced by splitOnP p L,
interspersed with the elements L.filter p.
intercalate [x] is the left inverse of splitOn x
theorem
List.splitOn_intercalate
{α : Type u_1}
(ls : List (List α))
[DecidableEq α]
(x : α)
(hx : ∀ l ∈ ls, x ∉ l)
(hls : ls ≠ [])
:
splitOn x is the left inverse of intercalate [x], on the domain
consisting of each nonempty list of lists ls whose elements do not contain x