File: Mathlib/Data/List/Enum.lean

full_name: List.getElem?_enumFrom
code: @[simp]
theorem getElem?_enumFrom :
    ∀ n (l : List α) m, (enumFrom n l)[m]? = l[m]?.map fun a => (n + m, a)
  
goal: (List.enumFrom n l)[m]? = Option.map (fun a => (n + m, a)) l[m]?

full_name: List.get?_enumFrom
code: theorem get?_enumFrom (n) (l : List α) (m) :
    get? (enumFrom n l) m = (get? l m).map fun a => (n + m, a) 
goal: (List.enumFrom n l).get? m = Option.map (fun a => (n + m, a)) (l.get? m)

full_name: List.getElem?_enum
code: @[simp]
theorem getElem?_enum (l : List α) (n : Nat) : (enum l)[n]? = l[n]?.map fun a => (n, a) 
goal: l.enum[n]? = Option.map (fun a => (n, a)) l[n]?

full_name: List.get?_enum
code: theorem get?_enum (l : List α) (n) : get? (enum l) n = (get? l n).map fun a => (n, a) 
goal: l.enum.get? n = Option.map (fun a => (n, a)) (l.get? n)

full_name: List.enumFrom_map_snd
code: @[simp]
theorem enumFrom_map_snd : ∀ (n) (l : List α), map Prod.snd (enumFrom n l) = l
  
goal: List.map Prod.snd (List.enumFrom n l) = l

full_name: List.enum_map_snd
code: @[simp]
theorem enum_map_snd (l : List α) : map Prod.snd (enum l) = l 
goal: List.map Prod.snd l.enum = l

full_name: List.getElem_enumFrom
code: @[simp]
theorem getElem_enumFrom (l : List α) (n) (i : Nat) (h : i < (l.enumFrom n).length) :
    (l.enumFrom n)[i] = (n + i, l[i]'(by simpa [enumFrom_length] using h)) 
goal: (List.enumFrom n l)[i] = (n + i, l[i])

full_name: List.get_enumFrom
code: theorem get_enumFrom (l : List α) (n) (i : Fin (l.enumFrom n).length) :
    (l.enumFrom n).get i = (n + i, l.get (i.cast enumFrom_length)) 
goal: (List.enumFrom n l).get i = (n + ↑i, l.get (Fin.cast ⋯ i))

full_name: List.getElem_enum
code: @[simp]
theorem getElem_enum (l : List α) (i : Nat) (h : i < l.enum.length) :
    l.enum[i] = (i, l[i]'(by simpa [enum_length] using h)) 
goal: l.enum[i] = (i, l[i])

full_name: List.get_enum
code: theorem get_enum (l : List α) (i : Fin l.enum.length) :
    l.enum.get i = (i.1, l.get (i.cast enum_length)) 
goal: l.enum.get i = (↑i, l.get (Fin.cast ⋯ i))

full_name: List.mk_add_mem_enumFrom_iff_get?
code: theorem mk_add_mem_enumFrom_iff_get? {n i : ℕ} {x : α} {l : List α} :
    (n + i, x) ∈ enumFrom n l ↔ l.get? i = x 
goal: (n + i, x) ∈ List.enumFrom n l ↔ l.get? i = some x

full_name: List.mk_mem_enumFrom_iff_le_and_get?_sub
code: theorem mk_mem_enumFrom_iff_le_and_get?_sub {n i : ℕ} {x : α} {l : List α} :
    (i, x) ∈ enumFrom n l ↔ n ≤ i ∧ l.get? (i - n) = x 
goal: (i, x) ∈ List.enumFrom n l ↔ n ≤ i ∧ l.get? (i - n) = some x

full_name: List.mk_mem_enum_iff_get?
code: theorem mk_mem_enum_iff_get? {i : ℕ} {x : α} {l : List α} : (i, x) ∈ enum l ↔ l.get? i = x 
goal: (i, x) ∈ l.enum ↔ l.get? i = some x

full_name: List.mem_enum_iff_get?
code: theorem mem_enum_iff_get? {x : ℕ × α} {l : List α} : x ∈ enum l ↔ l.get? x.1 = x.2 
goal: x ∈ l.enum ↔ l.get? x.1 = some x.2

full_name: List.le_fst_of_mem_enumFrom
code: theorem le_fst_of_mem_enumFrom {x : ℕ × α} {n : ℕ} {l : List α} (h : x ∈ enumFrom n l) :
    n ≤ x.1 
goal: n ≤ x.1

full_name: List.fst_lt_add_of_mem_enumFrom
code: theorem fst_lt_add_of_mem_enumFrom {x : ℕ × α} {n : ℕ} {l : List α} (h : x ∈ enumFrom n l) :
    x.1 < n + length l 
goal: x.1 < n + l.length

full_name: List.fst_lt_of_mem_enum
code: theorem fst_lt_of_mem_enum {x : ℕ × α} {l : List α} (h : x ∈ enum l) : x.1 < length l 
goal: x.1 < l.length

full_name: List.snd_mem_of_mem_enumFrom
code: theorem snd_mem_of_mem_enumFrom {x : ℕ × α} {n : ℕ} {l : List α} (h : x ∈ enumFrom n l) : x.2 ∈ l 
goal: x.2 ∈ l

full_name: List.snd_mem_of_mem_enum
code: theorem snd_mem_of_mem_enum {x : ℕ × α} {l : List α} (h : x ∈ enum l) : x.2 ∈ l 
goal: x.2 ∈ l

full_name: List.mem_enumFrom
code: theorem mem_enumFrom {x : α} {i j : ℕ} (xs : List α) (h : (i, x) ∈ xs.enumFrom j) :
    j ≤ i ∧ i < j + xs.length ∧ x ∈ xs 
goal: j ≤ i ∧ i < j + xs.length ∧ x ∈ xs

full_name: List.enumFrom_singleton
code: @[simp]
theorem enumFrom_singleton (x : α) (n : ℕ) : enumFrom n [x] = [(n, x)] 
goal: List.enumFrom n [x] = [(n, x)]

full_name: List.enum_singleton
code: @[simp]
theorem enum_singleton (x : α) : enum [x] = [(0, x)] 
goal: [x].enum = [(0, x)]

full_name: List.enumFrom_append
code: theorem enumFrom_append (xs ys : List α) (n : ℕ) :
    enumFrom n (xs ++ ys) = enumFrom n xs ++ enumFrom (n + xs.length) ys 
goal: List.enumFrom n (xs ++ ys) = List.enumFrom n xs ++ List.enumFrom (n + xs.length) ys

full_name: List.enum_append
code: theorem enum_append (xs ys : List α) : enum (xs ++ ys) = enum xs ++ enumFrom xs.length ys 
goal: (xs ++ ys).enum = xs.enum ++ List.enumFrom xs.length ys

full_name: List.map_fst_add_enumFrom_eq_enumFrom
code: theorem map_fst_add_enumFrom_eq_enumFrom (l : List α) (n k : ℕ) :
    map (Prod.map (· + n) id) (enumFrom k l) = enumFrom (n + k) l 
goal: List.map (Prod.map (fun x => x + n) id) (List.enumFrom k l) = List.enumFrom (n + k) l

full_name: List.map_fst_add_enum_eq_enumFrom
code: theorem map_fst_add_enum_eq_enumFrom (l : List α) (n : ℕ) :
    map (Prod.map (· + n) id) (enum l) = enumFrom n l 
goal: List.map (Prod.map (fun x => x + n) id) l.enum = List.enumFrom n l

full_name: List.enumFrom_cons'
code: theorem enumFrom_cons' (n : ℕ) (x : α) (xs : List α) :
    enumFrom n (x :: xs) = (n, x) :: (enumFrom n xs).map (Prod.map Nat.succ id) 
goal: List.enumFrom n (x :: xs) = (n, x) :: List.map (Prod.map Nat.succ id) (List.enumFrom n xs)

full_name: List.enum_cons'
code: theorem enum_cons' (x : α) (xs : List α) :
    enum (x :: xs) = (0, x) :: (enum xs).map (Prod.map Nat.succ id) 
goal: (x :: xs).enum = (0, x) :: List.map (Prod.map Nat.succ id) xs.enum

full_name: List.enumFrom_map
code: theorem enumFrom_map (n : ℕ) (l : List α) (f : α → β) :
    enumFrom n (l.map f) = (enumFrom n l).map (Prod.map id f) 
goal: List.enumFrom n (List.map f l) = List.map (Prod.map id f) (List.enumFrom n l)

full_name: List.enum_map
code: theorem enum_map (l : List α) (f : α → β) : (l.map f).enum = l.enum.map (Prod.map id f) 
goal: (List.map f l).enum = List.map (Prod.map id f) l.enum

full_name: List.enumFrom_eq_nil
code: @[simp]
theorem enumFrom_eq_nil {n : ℕ} {l : List α} : List.enumFrom n l = [] ↔ l = [] 
goal: List.enumFrom n l = [] ↔ l = []

full_name: List.enum_eq_nil
code: @[simp]
theorem enum_eq_nil {l : List α} : List.enum l = [] ↔ l = [] 
goal: l.enum = [] ↔ l = []