Lemmas about List.range
and List.enum
#
Ranges and enumeration #
range' #
range #
iota #
enumFrom #
@[simp]
theorem
List.head?_enumFrom
{α : Type u_1}
(n : Nat)
(l : List α)
:
(enumFrom n l).head? = Option.map (fun (a : α) => (n, a)) l.head?
@[simp]
theorem
List.getLast?_enumFrom
{α : Type u_1}
(n : Nat)
(l : List α)
:
(enumFrom n l).getLast? = Option.map (fun (a : α) => (n + l.length - 1, a)) l.getLast?
enum #
@[simp]
theorem
List.getElem?_enum
{α : Type u_1}
(l : List α)
(n : Nat)
:
l.enum[n]? = Option.map (fun (a : α) => (n, a)) l[n]?
@[simp]
theorem
List.head?_enum
{α : Type u_1}
(l : List α)
:
l.enum.head? = Option.map (fun (a : α) => (0, a)) l.head?
@[simp]
theorem
List.getLast?_enum
{α : Type u_1}
(l : List α)
:
l.enum.getLast? = Option.map (fun (a : α) => (l.length - 1, a)) l.getLast?