@[simp]
theorem
List.get?_enumFrom
{α : Type u_1}
(n : ℕ)
(l : List α)
(m : ℕ)
:
(List.enumFrom n l).get? m = Option.map (fun (a : α) => (n + m, a)) (l.get? m)
@[deprecated List.get?_enumFrom]
theorem
List.enumFrom_get?
{α : Type u_1}
(n : ℕ)
(l : List α)
(m : ℕ)
:
(List.enumFrom n l).get? m = Option.map (fun (a : α) => (n + m, a)) (l.get? m)
Alias of List.get?_enumFrom
.
@[simp]
theorem
List.get?_enum
{α : Type u_1}
(l : List α)
(n : ℕ)
:
l.enum.get? n = Option.map (fun (a : α) => (n, a)) (l.get? n)
@[deprecated List.get?_enum]
theorem
List.enum_get?
{α : Type u_1}
(l : List α)
(n : ℕ)
:
l.enum.get? n = Option.map (fun (a : α) => (n, a)) (l.get? n)
Alias of List.get?_enum
.
@[simp]
theorem
List.enumFrom_map_snd
{α : Type u_1}
(n : ℕ)
(l : List α)
:
List.map Prod.snd (List.enumFrom n l) = l
@[simp]
theorem
List.get_enumFrom
{α : Type u_1}
(l : List α)
(n : ℕ)
(i : Fin (List.enumFrom n l).length)
:
(List.enumFrom n l).get i = (n + ↑i, l.get (Fin.cast ⋯ i))
theorem
List.le_fst_of_mem_enumFrom
{α : Type u_1}
{x : ℕ × α}
{n : ℕ}
{l : List α}
(h : x ∈ List.enumFrom n l)
:
n ≤ x.1
theorem
List.snd_mem_of_mem_enumFrom
{α : Type u_1}
{x : ℕ × α}
{n : ℕ}
{l : List α}
(h : x ∈ List.enumFrom n l)
:
x.2 ∈ l
@[simp]
theorem
List.enum_cons
{α : Type u_1}
(x : α)
(xs : List α)
:
(x :: xs).enum = (0, x) :: List.enumFrom 1 xs
@[simp]
theorem
List.enumFrom_append
{α : Type u_1}
(xs : List α)
(ys : List α)
(n : ℕ)
:
List.enumFrom n (xs ++ ys) = List.enumFrom n xs ++ List.enumFrom (n + xs.length) ys
theorem
List.enum_append
{α : Type u_1}
(xs : List α)
(ys : List α)
:
(xs ++ ys).enum = xs.enum ++ List.enumFrom xs.length ys
theorem
List.map_fst_add_enumFrom_eq_enumFrom
{α : Type u_1}
(l : List α)
(n : ℕ)
(k : ℕ)
:
List.map (Prod.map (fun (x : ℕ) => x + n) id) (List.enumFrom k l) = List.enumFrom (n + k) l
theorem
List.enumFrom_cons'
{α : Type u_1}
(n : ℕ)
(x : α)
(xs : List α)
:
List.enumFrom n (x :: xs) = (n, x) :: List.map (Prod.map Nat.succ id) (List.enumFrom n xs)
theorem
List.enumFrom_map
{α : Type u_1}
{β : Type u_2}
(n : ℕ)
(l : List α)
(f : α → β)
:
List.enumFrom n (List.map f l) = List.map (Prod.map id f) (List.enumFrom n l)
@[simp]