Lemmas about List.findSome?
, List.find?
, List.findIdx
, List.findIdx?
, List.indexOf
,
and List.lookup
.
findSome? #
@[reducible, inline, deprecated List.findSome?_eq_none_iff (since := "2024-09-05")]
abbrev
List.findSome?_eq_none
{α✝ : Type u_1}
{α✝¹ : Type u_2}
{p : α✝ → Option α✝¹}
{l : List α✝}
:
Instances For
@[simp]
theorem
List.map_findSome?
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → Option β)
(g : β → γ)
(l : List α)
:
Option.map g (findSome? f l) = findSome? (Option.map g ∘ f) l
find? #
@[reducible, inline, deprecated List.find?_eq_some_iff_append (since := "2024-11-06")]
Instances For
If find? p
returns some a
from xs.flatten
, then p a
holds, and
some list in xs
contains a
, and no earlier element of that list satisfies p
.
Moreover, no earlier list in xs
has an element satisfying p
.
findIdx #
theorem
List.findIdx_cons.findIdx_go_succ
{α : Type u_1}
(p : α → Bool)
(l : List α)
(n : Nat)
:
findIdx.go p l (n + 1) = findIdx.go p l n + 1
findIdx? #
indexOf #
lookup #
Deprecations #
@[reducible, inline, deprecated List.find?_flatten_eq_none (since := "2024-10-14")]
Instances For
@[reducible, inline, deprecated List.find?_flatten_eq_some (since := "2024-10-14")]
Instances For
@[reducible, inline, deprecated List.findIdx?_flatten (since := "2024-10-14")]