Properties of List.reduceOption
#
In this file we prove basic lemmas about List.reduceOption
.
@[simp]
theorem
List.reduceOption_map
{α : Type u_1}
{β : Type u_2}
{l : List (Option α)}
{f : α → β}
:
(List.map (Option.map f) l).reduceOption = List.map f l.reduceOption
theorem
List.reduceOption_length_eq
{α : Type u_1}
{l : List (Option α)}
:
l.reduceOption.length = (List.filter Option.isSome l).length
theorem
List.length_eq_reduceOption_length_add_filter_none
{α : Type u_1}
{l : List (Option α)}
:
l.length = l.reduceOption.length + (List.filter Option.isNone l).length