@[simp]
@[deprecated List.splitOnPPrepend_ne_nil (since := "2026-02-26")]
@[simp]
@[deprecated List.splitOnPPrepend_eq_modifyHead (since := "2026-02-26")]
The original list L can be recovered by flattening the lists produced by splitOnP p L,
interspersed with the elements L.filter p.
theorem
List.splitOnP_append_cons_of_forall_mem
{α : Type u_1}
{p : α → Bool}
{xs : List α}
(h : ∀ (x : α), x ∈ xs → p x = false)
(sep : α)
(hsep : p sep = true)
(as : List α)
:
When a list of the form [...xs, sep, ...as] is split on p, the first element is xs,
assuming no element in xs satisfies p but sep does satisfy p
theorem
List.splitOn_append_cons_of_forall_mem_beq_eq_false
{α : Type u_1}
{xs : List α}
[BEq α]
{a : α}
(h : ∀ (x : α), x ∈ xs → (x == a) = false)
(sep : α)
(hsep : (sep == a) = true)
(as : List α)
:
When a list of the form [...xs, sep, ...as] is split at a, the first element is xs,
assuming no element in xs is equal to a but sep is equal to a.