File: .lake/packages/batteries/Batteries/Data/List/Lemmas.lean

full_name: List.mem_toArray
code: @[simp] theorem mem_toArray {a : α} {l : List α} : a ∈ l.toArray ↔ a ∈ l 
goal: a ∈ List.toArray l ↔ a ∈ l

full_name: List.drop_one
code: @[simp]
theorem drop_one : ∀ l : List α, drop 1 l = tail l
  
goal: List.drop 1 l = l.tail

full_name: List.zipWith_distrib_tail
code: theorem zipWith_distrib_tail : (zipWith f l l').tail = zipWith f l.tail l'.tail 
goal: ∀ {α : Type u_1} {α_1 : Type u_2} {α_2 : Type u_3} {f : α → α_1 → α_2} {l : List α} {l' : List α_1},
  (List.zipWith f l l').tail = List.zipWith f l.tail l'.tail

full_name: List.subset_def
code: theorem subset_def {l₁ l₂ : List α} : l₁ ⊆ l₂ ↔ ∀ {a : α}, a ∈ l₁ → a ∈ l₂ 
goal: l₁ ⊆ l₂ ↔ ∀ {a : α}, a ∈ l₁ → a ∈ l₂

full_name: List.nil_subset
code: @[simp] theorem nil_subset (l : List α) : [] ⊆ l 
goal: [] ⊆ l

full_name: List.Subset.refl
code: @[simp] theorem Subset.refl (l : List α) : l ⊆ l 
goal: l ⊆ l

full_name: List.Subset.trans
code: theorem Subset.trans {l₁ l₂ l₃ : List α} (h₁ : l₁ ⊆ l₂) (h₂ : l₂ ⊆ l₃) : l₁ ⊆ l₃ 
goal: l₁ ⊆ l₃

full_name: List.«instTransMemSubset_.lake»
code: instance : Trans (Membership.mem : α → List α → Prop) Subset Membership.mem 
goal: Trans Membership.mem Subset Membership.mem

full_name: List.«instTransSubset_.lake»
code: instance : Trans (Subset : List α → List α → Prop) Subset Subset 
goal: Trans Subset Subset Subset

full_name: List.subset_cons
code: @[simp] theorem subset_cons (a : α) (l : List α) : l ⊆ a :: l 
goal: l ⊆ a :: l

full_name: List.subset_of_cons_subset
code: theorem subset_of_cons_subset {a : α} {l₁ l₂ : List α} : a :: l₁ ⊆ l₂ → l₁ ⊆ l₂ 
goal: a :: l₁ ⊆ l₂ → l₁ ⊆ l₂

full_name: List.subset_cons_of_subset
code: theorem subset_cons_of_subset (a : α) {l₁ l₂ : List α} : l₁ ⊆ l₂ → l₁ ⊆ a :: l₂ 
goal: l₁ ⊆ l₂ → l₁ ⊆ a :: l₂

full_name: List.cons_subset_cons
code: theorem cons_subset_cons {l₁ l₂ : List α} (a : α) (s : l₁ ⊆ l₂) : a :: l₁ ⊆ a :: l₂ 
goal: a :: l₁ ⊆ a :: l₂

full_name: List.subset_append_left
code: @[simp] theorem subset_append_left (l₁ l₂ : List α) : l₁ ⊆ l₁ ++ l₂ 
goal: l₁ ⊆ l₁ ++ l₂

full_name: List.subset_append_right
code: @[simp] theorem subset_append_right (l₁ l₂ : List α) : l₂ ⊆ l₁ ++ l₂ 
goal: l₂ ⊆ l₁ ++ l₂

full_name: List.subset_append_of_subset_left
code: theorem subset_append_of_subset_left (l₂ : List α) : l ⊆ l₁ → l ⊆ l₁ ++ l₂ 
goal: l ⊆ l₁ → l ⊆ l₁ ++ l₂

full_name: List.subset_append_of_subset_right
code: theorem subset_append_of_subset_right (l₁ : List α) : l ⊆ l₂ → l ⊆ l₁ ++ l₂ 
goal: l ⊆ l₂ → l ⊆ l₁ ++ l₂

full_name: List.cons_subset
code: @[simp] theorem cons_subset : a :: l ⊆ m ↔ a ∈ m ∧ l ⊆ m 
goal: ∀ {α : Type u_1} {a : α} {l m : List α}, a :: l ⊆ m ↔ a ∈ m ∧ l ⊆ m

full_name: List.append_subset
code: @[simp] theorem append_subset {l₁ l₂ l : List α} :
    l₁ ++ l₂ ⊆ l ↔ l₁ ⊆ l ∧ l₂ ⊆ l 
goal: l₁ ++ l₂ ⊆ l ↔ l₁ ⊆ l ∧ l₂ ⊆ l

full_name: List.subset_nil
code: theorem subset_nil {l : List α} : l ⊆ [] ↔ l = [] 
goal: l ⊆ [] ↔ l = []

full_name: List.map_subset
code: theorem map_subset {l₁ l₂ : List α} (f : α → β) (H : l₁ ⊆ l₂) : map f l₁ ⊆ map f l₂ 
goal: List.map f l₁ ⊆ List.map f l₂

full_name: List.nil_sublist
code: @[simp] theorem nil_sublist : ∀ l : List α, [] <+ l
  
goal: [] <+ l

full_name: List.Sublist.refl
code: @[simp] theorem Sublist.refl : ∀ l : List α, l <+ l
  
goal: l <+ l

full_name: List.Sublist.trans
code: theorem Sublist.trans {l₁ l₂ l₃ : List α} (h₁ : l₁ <+ l₂) (h₂ : l₂ <+ l₃) : l₁ <+ l₃ 
goal: l₁ <+ l₃

full_name: List.«instTransSublist_.lake»
code: instance : Trans (@Sublist α) Sublist Sublist 
goal: Trans List.Sublist List.Sublist List.Sublist

full_name: List.sublist_cons
code: @[simp] theorem sublist_cons (a : α) (l : List α) : l <+ a :: l 
goal: l <+ a :: l

full_name: List.sublist_of_cons_sublist
code: theorem sublist_of_cons_sublist : a :: l₁ <+ l₂ → l₁ <+ l₂ 
goal: ∀ {α : Type u_1} {a : α} {l₁ l₂ : List α}, a :: l₁ <+ l₂ → l₁ <+ l₂

full_name: List.sublist_append_left
code: @[simp] theorem sublist_append_left : ∀ l₁ l₂ : List α, l₁ <+ l₁ ++ l₂
  
goal: l₁ <+ l₁ ++ l₂

full_name: List.sublist_append_right
code: @[simp] theorem sublist_append_right : ∀ l₁ l₂ : List α, l₂ <+ l₁ ++ l₂
  
goal: l₂ <+ l₁ ++ l₂

full_name: List.sublist_append_of_sublist_left
code: theorem sublist_append_of_sublist_left (s : l <+ l₁) : l <+ l₁ ++ l₂ 
goal: ∀ {α : Type u_1} {l l₁ l₂ : List α}, l <+ l₁ → l <+ l₁ ++ l₂

full_name: List.sublist_append_of_sublist_right
code: theorem sublist_append_of_sublist_right (s : l <+ l₂) : l <+ l₁ ++ l₂ 
goal: ∀ {α : Type u_1} {l l₂ l₁ : List α}, l <+ l₂ → l <+ l₁ ++ l₂

full_name: List.cons_sublist_cons
code: @[simp]
theorem cons_sublist_cons : a :: l₁ <+ a :: l₂ ↔ l₁ <+ l₂ 
goal: ∀ {α : Type u_1} {a : α} {l₁ l₂ : List α}, a :: l₁ <+ a :: l₂ ↔ l₁ <+ l₂

full_name: List.append_sublist_append_left
code: @[simp] theorem append_sublist_append_left : ∀ l, l ++ l₁ <+ l ++ l₂ ↔ l₁ <+ l₂
  
goal: ∀ {α : Type u_1} {l₁ l₂ : List α} (l : List α), l ++ l₁ <+ l ++ l₂ ↔ l₁ <+ l₂

full_name: List.Sublist.append_left
code: theorem Sublist.append_left : l₁ <+ l₂ → ∀ l, l ++ l₁ <+ l ++ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+ l₂ → ∀ (l : List α), l ++ l₁ <+ l ++ l₂

full_name: List.Sublist.append_right
code: theorem Sublist.append_right : l₁ <+ l₂ → ∀ l, l₁ ++ l <+ l₂ ++ l
  
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+ l₂ → ∀ (l : List α), l₁ ++ l <+ l₂ ++ l

full_name: List.sublist_or_mem_of_sublist
code: theorem sublist_or_mem_of_sublist (h : l <+ l₁ ++ a :: l₂) : l <+ l₁ ++ l₂ ∨ a ∈ l 
goal: ∀ {α : Type u_1} {l l₁ : List α} {a : α} {l₂ : List α}, l <+ l₁ ++ a :: l₂ → l <+ l₁ ++ l₂ ∨ a ∈ l

full_name: List.Sublist.reverse
code: theorem Sublist.reverse : l₁ <+ l₂ → l₁.reverse <+ l₂.reverse
  
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+ l₂ → l₁.reverse <+ l₂.reverse

full_name: List.reverse_sublist
code: @[simp] theorem reverse_sublist : l₁.reverse <+ l₂.reverse ↔ l₁ <+ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.reverse <+ l₂.reverse ↔ l₁ <+ l₂

full_name: List.append_sublist_append_right
code: @[simp] theorem append_sublist_append_right (l) : l₁ ++ l <+ l₂ ++ l ↔ l₁ <+ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α} (l : List α), l₁ ++ l <+ l₂ ++ l ↔ l₁ <+ l₂

full_name: List.Sublist.append
code: theorem Sublist.append (hl : l₁ <+ l₂) (hr : r₁ <+ r₂) : l₁ ++ r₁ <+ l₂ ++ r₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ r₁ r₂ : List α}, l₁ <+ l₂ → r₁ <+ r₂ → l₁ ++ r₁ <+ l₂ ++ r₂

full_name: List.Sublist.subset
code: theorem Sublist.subset : l₁ <+ l₂ → l₁ ⊆ l₂
  
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+ l₂ → l₁ ⊆ l₂

full_name: List.«instTransSublistSubset_.lake»
code: instance : Trans (@Sublist α) Subset Subset 
goal: Trans List.Sublist Subset Subset

full_name: List.«instTransSubsetSublist_.lake»
code: instance : Trans Subset (@Sublist α) Subset 
goal: Trans Subset List.Sublist Subset

full_name: List.«instTransMemSublist_.lake»
code: instance : Trans (Membership.mem : α → List α → Prop) Sublist Membership.mem 
goal: Trans Membership.mem List.Sublist Membership.mem

full_name: List.Sublist.length_le
code: theorem Sublist.length_le : l₁ <+ l₂ → length l₁ ≤ length l₂
  
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+ l₂ → l₁.length ≤ l₂.length

full_name: List.sublist_nil
code: @[simp] theorem sublist_nil {l : List α} : l <+ [] ↔ l = [] 
goal: l <+ [] ↔ l = []

full_name: List.Sublist.eq_of_length
code: theorem Sublist.eq_of_length : l₁ <+ l₂ → length l₁ = length l₂ → l₁ = l₂
  
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+ l₂ → l₁.length = l₂.length → l₁ = l₂

full_name: List.Sublist.eq_of_length_le
code: theorem Sublist.eq_of_length_le (s : l₁ <+ l₂) (h : length l₂ ≤ length l₁) : l₁ = l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+ l₂ → l₂.length ≤ l₁.length → l₁ = l₂

full_name: List.singleton_sublist
code: @[simp] theorem singleton_sublist {a : α} {l} : [a] <+ l ↔ a ∈ l 
goal: [a] <+ l ↔ a ∈ l

full_name: List.replicate_sublist_replicate
code: @[simp] theorem replicate_sublist_replicate {m n} (a : α) :
    replicate m a <+ replicate n a ↔ m ≤ n 
goal: List.replicate m a <+ List.replicate n a ↔ m ≤ n

full_name: List.isSublist_iff_sublist
code: theorem isSublist_iff_sublist [BEq α] [LawfulBEq α] {l₁ l₂ : List α} :
    l₁.isSublist l₂ ↔ l₁ <+ l₂ 
goal: l₁.isSublist l₂ = true ↔ l₁ <+ l₂

full_name: List.«instDecidableSublistOfDecidableEq_.lake»
code: instance [DecidableEq α] (l₁ l₂ : List α) : Decidable (l₁ <+ l₂) 
goal: Decidable (l₁ <+ l₂)

full_name: List.tail_eq_tailD
code: theorem tail_eq_tailD (l) : @tail α l = tailD l [] 
goal: l.tail = l.tailD []

full_name: List.tail_eq_tail?
code: theorem tail_eq_tail? (l) : @tail α l = (tail? l).getD [] 
goal: l.tail = l.tail?.getD []

full_name: List.next?_nil
code: @[simp] theorem next?_nil : @next? α [] = none 
goal: [].next? = none

full_name: List.next?_cons
code: @[simp] theorem next?_cons (a l) : @next? α (a :: l) = some (a, l) 
goal: (a :: l).next? = some (a, l)

full_name: List.getElem_eq_iff
code: theorem getElem_eq_iff {l : List α} {n : Nat} {h : n < l.length} : l[n] = x ↔ l[n]? = some x 
goal: l[n] = x ↔ l[n]? = some x

full_name: List.get_eq_iff
code: @[deprecated getElem_eq_iff (since := "2024-06-12")]
theorem get_eq_iff : List.get l n = x ↔ l.get? n.1 = some x 
goal: ∀ {α : Type u_1} {l : List α} {n : Fin l.length} {x : α}, l.get n = x ↔ l.get? ↑n = some x

full_name: List.getElem?_inj
code: theorem getElem?_inj
    (h₀ : i < xs.length) (h₁ : Nodup xs) (h₂ : xs[i]? = xs[j]?) : i = j 
goal: ∀ {α : Type u_1} {xs : List α} {j : Nat}, i < xs.length → xs.Nodup → xs[i]? = xs[j]? → i = j

full_name: List.get?_inj
code: @[deprecated getElem?_inj (since := "2024-06-12")]
theorem get?_inj
    (h₀ : i < xs.length) (h₁ : Nodup xs) (h₂ : xs.get? i = xs.get? j) : i = j 
goal: ∀ {α : Type u_1} {xs : List α} {j : Nat}, i < xs.length → xs.Nodup → xs.get? i = xs.get? j → i = j

full_name: List.tail_drop
code: theorem tail_drop (l : List α) (n : Nat) : (l.drop n).tail = l.drop (n + 1) 
goal: (List.drop n l).tail = List.drop (n + 1) l

full_name: List.modifyNth_nil
code: @[simp] theorem modifyNth_nil (f : α → α) (n) : [].modifyNth f n = [] 
goal: List.modifyNth f n [] = []

full_name: List.modifyNth_zero_cons
code: @[simp] theorem modifyNth_zero_cons (f : α → α) (a : α) (l : List α) :
    (a :: l).modifyNth f 0 = f a :: l 
goal: List.modifyNth f 0 (a :: l) = f a :: l

full_name: List.modifyNth_succ_cons
code: @[simp] theorem modifyNth_succ_cons (f : α → α) (a : α) (l : List α) (n) :
    (a :: l).modifyNth f (n + 1) = a :: l.modifyNth f n 
goal: List.modifyNth f (n + 1) (a :: l) = a :: List.modifyNth f n l

full_name: List.modifyNthTail_id
code: theorem modifyNthTail_id : ∀ n (l : List α), l.modifyNthTail id n = l
  
goal: List.modifyNthTail id n l = l

full_name: List.eraseIdx_eq_modifyNthTail
code: theorem eraseIdx_eq_modifyNthTail : ∀ n (l : List α), eraseIdx l n = modifyNthTail tail n l
  
goal: l.eraseIdx n = List.modifyNthTail List.tail n l

full_name: List.getElem?_modifyNth
code: theorem getElem?_modifyNth (f : α → α) :
    ∀ n (l : List α) m, (modifyNth f n l)[m]? = (fun a => if n = m then f a else a) <$> l[m]?
  
goal: (List.modifyNth f n l)[m]? = (fun a => if n = m then f a else a) <$> l[m]?

full_name: List.get?_modifyNth
code: @[deprecated getElem?_modifyNth (since := "2024-06-12")]
theorem get?_modifyNth (f : α → α) (n) (l : List α) (m) :
    (modifyNth f n l).get? m = (fun a => if n = m then f a else a) <$> l.get? m 
goal: (List.modifyNth f n l).get? m = (fun a => if n = m then f a else a) <$> l.get? m

full_name: List.modifyNthTail_length
code: theorem modifyNthTail_length (f : List α → List α) (H : ∀ l, length (f l) = length l) :
    ∀ n l, length (modifyNthTail f n l) = length l
  
goal: (List.modifyNthTail f n l).length = l.length

full_name: List.modifyNthTail_add
code: theorem modifyNthTail_add (f : List α → List α) (n) (l₁ l₂ : List α) :
    modifyNthTail f (l₁.length + n) (l₁ ++ l₂) = l₁ ++ modifyNthTail f n l₂ 
goal: List.modifyNthTail f (l₁.length + n) (l₁ ++ l₂) = l₁ ++ List.modifyNthTail f n l₂

full_name: List.exists_of_modifyNthTail
code: theorem exists_of_modifyNthTail (f : List α → List α) {n} {l : List α} (h : n ≤ l.length) :
    ∃ l₁ l₂, l = l₁ ++ l₂ ∧ l₁.length = n ∧ modifyNthTail f n l = l₁ ++ f l₂ 
goal: ∃ l₁ l₂, l = l₁ ++ l₂ ∧ l₁.length = n ∧ List.modifyNthTail f n l = l₁ ++ f l₂

full_name: List.modify_get?_length
code: @[simp] theorem modify_get?_length (f : α → α) : ∀ n l, length (modifyNth f n l) = length l 
goal: (List.modifyNth f n l).length = l.length

full_name: List.getElem?_modifyNth_eq
code: @[simp] theorem getElem?_modifyNth_eq (f : α → α) (n) (l : List α) :
    (modifyNth f n l)[n]? = f <$> l[n]? 
goal: (List.modifyNth f n l)[n]? = f <$> l[n]?

full_name: List.get?_modifyNth_eq
code: @[deprecated getElem?_modifyNth_eq (since := "2024-06-12")]
theorem get?_modifyNth_eq (f : α → α) (n) (l : List α) :
    (modifyNth f n l).get? n = f <$> l.get? n 
goal: (List.modifyNth f n l).get? n = f <$> l.get? n

full_name: List.getElem?_modifyNth_ne
code: @[simp] theorem getElem?_modifyNth_ne (f : α → α) {m n} (l : List α) (h : m ≠ n) :
    (modifyNth f m l)[n]? = l[n]? 
goal: (List.modifyNth f m l)[n]? = l[n]?

full_name: List.get?_modifyNth_ne
code: @[deprecated getElem?_modifyNth_ne (since := "2024-06-12")]
theorem get?_modifyNth_ne (f : α → α) {m n} (l : List α) (h : m ≠ n) :
    (modifyNth f m l).get? n = l.get? n 
goal: (List.modifyNth f m l).get? n = l.get? n

full_name: List.exists_of_modifyNth
code: theorem exists_of_modifyNth (f : α → α) {n} {l : List α} (h : n < l.length) :
    ∃ l₁ a l₂, l = l₁ ++ a :: l₂ ∧ l₁.length = n ∧ modifyNth f n l = l₁ ++ f a :: l₂ 
goal: ∃ l₁ a l₂, l = l₁ ++ a :: l₂ ∧ l₁.length = n ∧ List.modifyNth f n l = l₁ ++ f a :: l₂

full_name: List.modifyNthTail_eq_take_drop
code: theorem modifyNthTail_eq_take_drop (f : List α → List α) (H : f [] = []) :
    ∀ n l, modifyNthTail f n l = take n l ++ f (drop n l)
  
goal: List.modifyNthTail f n l = List.take n l ++ f (List.drop n l)

full_name: List.modifyNth_eq_take_drop
code: theorem modifyNth_eq_take_drop (f : α → α) :
    ∀ n l, modifyNth f n l = take n l ++ modifyHead f (drop n l) 
goal: List.modifyNth f n l = List.take n l ++ List.modifyHead f (List.drop n l)

full_name: List.modifyNth_eq_take_cons_drop
code: theorem modifyNth_eq_take_cons_drop (f : α → α) {n l} (h : n < length l) :
    modifyNth f n l = take n l ++ f l[n] :: drop (n + 1) l 
goal: List.modifyNth f n l = List.take n l ++ f l[n] :: List.drop (n + 1) l

full_name: List.set_eq_modifyNth
code: theorem set_eq_modifyNth (a : α) : ∀ n (l : List α), set l n a = modifyNth (fun _ => a) n l
  
goal: l.set n a = List.modifyNth (fun x => a) n l

full_name: List.set_eq_take_cons_drop
code: theorem set_eq_take_cons_drop (a : α) {n l} (h : n < length l) :
    set l n a = take n l ++ a :: drop (n + 1) l 
goal: l.set n a = List.take n l ++ a :: List.drop (n + 1) l

full_name: List.modifyNth_eq_set_get?
code: theorem modifyNth_eq_set_get? (f : α → α) :
    ∀ n (l : List α), l.modifyNth f n = ((fun a => l.set n (f a)) <$> l.get? n).getD l
  
goal: List.modifyNth f n l = ((fun a => l.set n (f a)) <$> l.get? n).getD l

full_name: List.modifyNth_eq_set_get
code: theorem modifyNth_eq_set_get (f : α → α) {n} {l : List α} (h) :
    l.modifyNth f n = l.set n (f (l.get ⟨n, h⟩)) 
goal: List.modifyNth f n l = l.set n (f (l.get ⟨n, h⟩))

full_name: List.exists_of_set
code: theorem exists_of_set {l : List α} (h : n < l.length) :
    ∃ l₁ a l₂, l = l₁ ++ a :: l₂ ∧ l₁.length = n ∧ l.set n a' = l₁ ++ a' :: l₂ 
goal: ∃ l₁ a l₂, l = l₁ ++ a :: l₂ ∧ l₁.length = n ∧ l.set n a' = l₁ ++ a' :: l₂

full_name: List.exists_of_set'
code: theorem exists_of_set' {l : List α} (h : n < l.length) :
    ∃ l₁ l₂, l = l₁ ++ l[n] :: l₂ ∧ l₁.length = n ∧ l.set n a' = l₁ ++ a' :: l₂ 
goal: ∃ l₁ l₂, l = l₁ ++ l[n] :: l₂ ∧ l₁.length = n ∧ l.set n a' = l₁ ++ a' :: l₂

full_name: List.getElem?_set_eq'
code: @[simp]
theorem getElem?_set_eq' (a : α) (n) (l : List α) : (set l n a)[n]? = (fun _ => a) <$> l[n]? 
goal: (l.set n a)[n]? = (fun x => a) <$> l[n]?

full_name: List.get?_set_eq
code: @[deprecated getElem?_set_eq' (since := "2024-06-12")]
theorem get?_set_eq (a : α) (n) (l : List α) : (set l n a).get? n = (fun _ => a) <$> l.get? n 
goal: (l.set n a).get? n = (fun x => a) <$> l.get? n

full_name: List.getElem?_set_eq_of_lt
code: theorem getElem?_set_eq_of_lt (a : α) {n} {l : List α} (h : n < length l) :
    (set l n a)[n]? = some a 
goal: (l.set n a)[n]? = some a

full_name: List.get?_set_eq_of_lt
code: @[deprecated getElem?_set_eq_of_lt (since := "2024-06-12")]
theorem get?_set_eq_of_lt (a : α) {n} {l : List α} (h : n < length l) :
    (set l n a).get? n = some a 
goal: (l.set n a).get? n = some a

full_name: List.get?_set_ne
code: @[deprecated getElem?_set_ne (since := "2024-06-12")]
theorem get?_set_ne (a : α) {m n} (l : List α) (h : m ≠ n) : (set l m a).get? n = l.get? n 
goal: (l.set m a).get? n = l.get? n

full_name: List.getElem?_set'
code: theorem getElem?_set' (a : α) {m n} (l : List α) :
    (set l m a)[n]? = if m = n then (fun _ => a) <$> l[n]? else l[n]? 
goal: (l.set m a)[n]? = if m = n then (fun x => a) <$> l[n]? else l[n]?

full_name: List.get?_set
code: @[deprecated getElem?_set (since := "2024-06-12")]
theorem get?_set (a : α) {m n} (l : List α) :
    (set l m a).get? n = if m = n then (fun _ => a) <$> l.get? n else l.get? n 
goal: (l.set m a).get? n = if m = n then (fun x => a) <$> l.get? n else l.get? n

full_name: List.get?_set_of_lt
code: theorem get?_set_of_lt (a : α) {m n} (l : List α) (h : n < length l) :
    (set l m a).get? n = if m = n then some a else l.get? n 
goal: (l.set m a).get? n = if m = n then some a else l.get? n

full_name: List.get?_set_of_lt'
code: theorem get?_set_of_lt' (a : α) {m n} (l : List α) (h : m < length l) :
    (set l m a).get? n = if m = n then some a else l.get? n 
goal: (l.set m a).get? n = if m = n then some a else l.get? n

full_name: List.drop_set_of_lt
code: theorem drop_set_of_lt (a : α) {n m : Nat} (l : List α) (h : n < m) :
    (l.set n a).drop m = l.drop m 
goal: List.drop m (l.set n a) = List.drop m l

full_name: List.take_set_of_lt
code: theorem take_set_of_lt (a : α) {n m : Nat} (l : List α) (h : m < n) :
    (l.set n a).take m = l.take m 
goal: List.take m (l.set n a) = List.take m l

full_name: List.length_eraseIdx
code: theorem length_eraseIdx : ∀ {l i}, i < length l → length (@eraseIdx α l i) = length l - 1
  
goal: i < l.length → (l.eraseIdx i).length = l.length - 1

full_name: List.length_tail
code: @[simp] theorem length_tail (l : List α) : length (tail l) = length l - 1 
goal: l.tail.length = l.length - 1

full_name: List.eraseP_nil
code: @[simp] theorem eraseP_nil : [].eraseP p = [] 
goal: ∀ {α : Type u_1} {p : α → Bool}, List.eraseP p [] = []

full_name: List.eraseP_cons
code: theorem eraseP_cons (a : α) (l : List α) :
    (a :: l).eraseP p = bif p a then l else a :: l.eraseP p 
goal: List.eraseP p (a :: l) = bif p a then l else a :: List.eraseP p l

full_name: List.eraseP_cons_of_pos
code: @[simp] theorem eraseP_cons_of_pos {l : List α} (p) (h : p a) : (a :: l).eraseP p = l 
goal: List.eraseP p (a :: l) = l

full_name: List.eraseP_cons_of_neg
code: @[simp] theorem eraseP_cons_of_neg {l : List α} (p) (h : ¬p a) :
    (a :: l).eraseP p = a :: l.eraseP p 
goal: List.eraseP p (a :: l) = a :: List.eraseP p l

full_name: List.eraseP_of_forall_not
code: theorem eraseP_of_forall_not {l : List α} (h : ∀ a, a ∈ l → ¬p a) : l.eraseP p = l 
goal: List.eraseP p l = l

full_name: List.exists_of_eraseP
code: theorem exists_of_eraseP : ∀ {l : List α} {a} (al : a ∈ l) (pa : p a),
    ∃ a l₁ l₂, (∀ b ∈ l₁, ¬p b) ∧ p a ∧ l = l₁ ++ a :: l₂ ∧ l.eraseP p = l₁ ++ l₂
  
goal: ∃ a l₁ l₂, (∀ (b : α), b ∈ l₁ → ¬p b = true) ∧ p a = true ∧ l = l₁ ++ a :: l₂ ∧ List.eraseP p l = l₁ ++ l₂

full_name: List.exists_or_eq_self_of_eraseP
code: theorem exists_or_eq_self_of_eraseP (p) (l : List α) :
    l.eraseP p = l ∨
    ∃ a l₁ l₂, (∀ b ∈ l₁, ¬p b) ∧ p a ∧ l = l₁ ++ a :: l₂ ∧ l.eraseP p = l₁ ++ l₂ 
goal: List.eraseP p l = l ∨
  ∃ a l₁ l₂, (∀ (b : α), b ∈ l₁ → ¬p b = true) ∧ p a = true ∧ l = l₁ ++ a :: l₂ ∧ List.eraseP p l = l₁ ++ l₂

full_name: List.length_eraseP_of_mem
code: @[simp] theorem length_eraseP_of_mem (al : a ∈ l) (pa : p a) :
    length (l.eraseP p) = Nat.pred (length l) 
goal: ∀ {α : Type u_1} {a : α} {l : List α} {p : α → Bool}, a ∈ l → p a = true → (List.eraseP p l).length = l.length.pred

full_name: List.eraseP_append_left
code: theorem eraseP_append_left {a : α} (pa : p a) :
    ∀ {l₁ : List α} l₂, a ∈ l₁ → (l₁++l₂).eraseP p = l₁.eraseP p ++ l₂
  
goal: a ∈ l₁ → List.eraseP p (l₁ ++ l₂) = List.eraseP p l₁ ++ l₂

full_name: List.eraseP_append_right
code: theorem eraseP_append_right :
    ∀ {l₁ : List α} l₂, (∀ b ∈ l₁, ¬p b) → eraseP p (l₁++l₂) = l₁ ++ l₂.eraseP p
  
goal: (∀ (b : α), b ∈ l₁ → ¬p b = true) → List.eraseP p (l₁ ++ l₂) = l₁ ++ List.eraseP p l₂

full_name: List.eraseP_sublist
code: theorem eraseP_sublist (l : List α) : l.eraseP p <+ l 
goal: List.eraseP p l <+ l

full_name: List.eraseP_subset
code: theorem eraseP_subset (l : List α) : l.eraseP p ⊆ l 
goal: List.eraseP p l ⊆ l

full_name: List.Sublist.eraseP
code: protected theorem Sublist.eraseP : l₁ <+ l₂ → l₁.eraseP p <+ l₂.eraseP p
  
goal: ∀ {α : Type u_1} {l₁ l₂ : List α} {p : α → Bool}, l₁ <+ l₂ → List.eraseP p l₁ <+ List.eraseP p l₂

full_name: List.mem_of_mem_eraseP
code: theorem mem_of_mem_eraseP {l : List α} : a ∈ l.eraseP p → a ∈ l 
goal: a ∈ List.eraseP p l → a ∈ l

full_name: List.mem_eraseP_of_neg
code: @[simp] theorem mem_eraseP_of_neg {l : List α} (pa : ¬p a) : a ∈ l.eraseP p ↔ a ∈ l 
goal: a ∈ List.eraseP p l ↔ a ∈ l

full_name: List.eraseP_map
code: theorem eraseP_map (f : β → α) : ∀ (l : List β), (map f l).eraseP p = map f (l.eraseP (p ∘ f))
  
goal: List.eraseP p (List.map f l) = List.map f (List.eraseP (p ∘ f) l)

full_name: List.extractP_eq_find?_eraseP
code: @[simp] theorem extractP_eq_find?_eraseP
    (l : List α) : extractP p l = (find? p l, eraseP p l) 
goal: List.extractP p l = (List.find? p l, List.eraseP p l)

full_name: List.extractP_eq_find?_eraseP.go
code: @[simp] theorem extractP_eq_find?_eraseP
    (l : List α) : extractP p l = (find? p l, eraseP p l) 
goal: l = acc.data ++ xs → List.extractP.go p l xs acc = (List.find? p xs, acc.data ++ List.eraseP p xs)

full_name: List.erase_eq_eraseP'
code: theorem erase_eq_eraseP' (a : α) (l : List α) : l.erase a = l.eraseP (· == a) 
goal: l.erase a = List.eraseP (fun x => x == a) l

full_name: List.erase_eq_eraseP
code: theorem erase_eq_eraseP [LawfulBEq α] (a : α) : ∀ l : List α,  l.erase a = l.eraseP (a == ·)
  
goal: l.erase a = List.eraseP (fun x => a == x) l

full_name: List.exists_erase_eq
code: theorem exists_erase_eq [LawfulBEq α] {a : α} {l : List α} (h : a ∈ l) :
    ∃ l₁ l₂, a ∉ l₁ ∧ l = l₁ ++ a :: l₂ ∧ l.erase a = l₁ ++ l₂ 
goal: ∃ l₁ l₂, ¬a ∈ l₁ ∧ l = l₁ ++ a :: l₂ ∧ l.erase a = l₁ ++ l₂

full_name: List.length_erase_of_mem
code: @[simp] theorem length_erase_of_mem [LawfulBEq α] {a : α} {l : List α} (h : a ∈ l) :
    length (l.erase a) = Nat.pred (length l) 
goal: (l.erase a).length = l.length.pred

full_name: List.erase_append_left
code: theorem erase_append_left [LawfulBEq α] {l₁ : List α} (l₂) (h : a ∈ l₁) :
    (l₁ ++ l₂).erase a = l₁.erase a ++ l₂ 
goal: (l₁ ++ l₂).erase a = l₁.erase a ++ l₂

full_name: List.erase_append_right
code: theorem erase_append_right [LawfulBEq α] {a : α} {l₁ : List α} (l₂ : List α) (h : a ∉ l₁) :
    (l₁ ++ l₂).erase a = (l₁ ++ l₂.erase a) 
goal: (l₁ ++ l₂).erase a = l₁ ++ l₂.erase a

full_name: List.erase_sublist
code: theorem erase_sublist (a : α) (l : List α) : l.erase a <+ l 
goal: l.erase a <+ l

full_name: List.erase_subset
code: theorem erase_subset (a : α) (l : List α) : l.erase a ⊆ l 
goal: l.erase a ⊆ l

full_name: List.Sublist.erase
code: theorem Sublist.erase (a : α) {l₁ l₂ : List α} (h : l₁ <+ l₂) : l₁.erase a <+ l₂.erase a 
goal: l₁.erase a <+ l₂.erase a

full_name: List.mem_of_mem_erase
code: theorem mem_of_mem_erase {a b : α} {l : List α} (h : a ∈ l.erase b) : a ∈ l 
goal: a ∈ l

full_name: List.mem_erase_of_ne
code: @[simp] theorem mem_erase_of_ne [LawfulBEq α] {a b : α} {l : List α} (ab : a ≠ b) :
    a ∈ l.erase b ↔ a ∈ l 
goal: a ∈ l.erase b ↔ a ∈ l

full_name: List.erase_comm
code: theorem erase_comm [LawfulBEq α] (a b : α) (l : List α) :
    (l.erase a).erase b = (l.erase b).erase a 
goal: (l.erase a).erase b = (l.erase b).erase a

full_name: List.filter_sublist
code: @[simp] theorem filter_sublist {p : α → Bool} : ∀ (l : List α), filter p l <+ l
  
goal: List.filter p l <+ l

full_name: List.Sublist.filterMap
code: protected theorem Sublist.filterMap (f : α → Option β) (s : l₁ <+ l₂) :
    filterMap f l₁ <+ filterMap f l₂ 
goal: List.filterMap f l₁ <+ List.filterMap f l₂

full_name: List.Sublist.filter
code: theorem Sublist.filter (p : α → Bool) {l₁ l₂} (s : l₁ <+ l₂) : filter p l₁ <+ filter p l₂ 
goal: List.filter p l₁ <+ List.filter p l₂

full_name: List.findIdx_nil
code: @[simp] theorem findIdx_nil {α : Type _} (p : α → Bool) : [].findIdx p = 0 
goal: List.findIdx p [] = 0

full_name: List.findIdx_cons.findIdx_go_succ
code: theorem findIdx_cons (p : α → Bool) (b : α) (l : List α) :
    (b :: l).findIdx p = bif p b then 0 else (l.findIdx p) + 1 
goal: List.findIdx.go p l (n + 1) = List.findIdx.go p l n + 1

full_name: List.findIdx_cons
code: theorem findIdx_cons (p : α → Bool) (b : α) (l : List α) :
    (b :: l).findIdx p = bif p b then 0 else (l.findIdx p) + 1 
goal: List.findIdx p (b :: l) = bif p b then 0 else List.findIdx p l + 1

full_name: List.findIdx_of_get?_eq_some
code: theorem findIdx_of_get?_eq_some {xs : List α} (w : xs.get? (xs.findIdx p) = some y) : p y 
goal: p y = true

full_name: List.findIdx_get
code: theorem findIdx_get {xs : List α} {w : xs.findIdx p < xs.length} :
    p (xs.get ⟨xs.findIdx p, w⟩) 
goal: p (xs.get ⟨List.findIdx p xs, w⟩) = true

full_name: List.findIdx_lt_length_of_exists
code: theorem findIdx_lt_length_of_exists {xs : List α} (h : ∃ x ∈ xs, p x) :
    xs.findIdx p < xs.length 
goal: List.findIdx p xs < xs.length

full_name: List.findIdx_get?_eq_get_of_exists
code: theorem findIdx_get?_eq_get_of_exists {xs : List α} (h : ∃ x ∈ xs, p x) :
    xs.get? (xs.findIdx p) = some (xs.get ⟨xs.findIdx p, xs.findIdx_lt_length_of_exists h⟩) 
goal: xs.get? (List.findIdx p xs) = some (xs.get ⟨List.findIdx p xs, ⋯⟩)

full_name: List.findIdx?_nil
code: @[simp] theorem findIdx?_nil : ([] : List α).findIdx? p i = none 
goal: List.findIdx? p [] i = none

full_name: List.findIdx?_cons
code: @[simp] theorem findIdx?_cons :
    (x :: xs).findIdx? p i = if p x then some i else findIdx? p xs (i + 1) 
goal: ∀ {α : Type u_1} {x : α} {xs : List α} {p : α → Bool} {i : Nat},
  List.findIdx? p (x :: xs) i = if p x = true then some i else List.findIdx? p xs (i + 1)

full_name: List.findIdx?_succ
code: @[simp] theorem findIdx?_succ :
    (xs : List α).findIdx? p (i+1) = (xs.findIdx? p i).map fun i => i + 1 
goal: List.findIdx? p xs (i + 1) = Option.map (fun i => i + 1) (List.findIdx? p xs i)

full_name: List.findIdx?_eq_some_iff
code: theorem findIdx?_eq_some_iff (xs : List α) (p : α → Bool) :
    xs.findIdx? p = some i ↔ (xs.take (i + 1)).map p = replicate i false ++ [true] 
goal: List.findIdx? p xs = some i ↔ List.map p (List.take (i + 1) xs) = List.replicate i false ++ [true]

full_name: List.findIdx?_of_eq_some
code: theorem findIdx?_of_eq_some {xs : List α} {p : α → Bool} (w : xs.findIdx? p = some i) :
    match xs.get? i with | some a => p a | none => false 
goal: match xs.get? i with
| some a => p a = true
| none => false = true

full_name: List.findIdx?_of_eq_none
code: theorem findIdx?_of_eq_none {xs : List α} {p : α → Bool} (w : xs.findIdx? p = none) :
    ∀ i, match xs.get? i with | some a => ¬ p a | none => true 
goal: match xs.get? i with
| some a => ¬p a = true
| none => true = true

full_name: List.findIdx?_append
code: @[simp] theorem findIdx?_append :
    (xs ++ ys : List α).findIdx? p =
      (xs.findIdx? p <|> (ys.findIdx? p).map fun i => i + xs.length) 
goal: List.findIdx? p (xs ++ ys) =
  HOrElse.hOrElse (List.findIdx? p xs) fun x => Option.map (fun i => i + xs.length) (List.findIdx? p ys)

full_name: List.findIdx?_replicate
code: @[simp] theorem findIdx?_replicate :
    (replicate n a).findIdx? p = if 0 < n ∧ p a then some 0 else none 
goal: ∀ {α : Type u_1} {a : α} {p : α → Bool},
  List.findIdx? p (List.replicate n a) = if 0 < n ∧ p a = true then some 0 else none

full_name: List.Pairwise.sublist
code: theorem Pairwise.sublist : l₁ <+ l₂ → l₂.Pairwise R → l₁.Pairwise R
  
goal: ∀ {α : Type u_1} {l₁ l₂ : List α} {R : α → α → Prop}, l₁ <+ l₂ → List.Pairwise R l₂ → List.Pairwise R l₁

full_name: List.pairwise_map
code: theorem pairwise_map {l : List α} :
    (l.map f).Pairwise R ↔ l.Pairwise fun a b => R (f a) (f b) 
goal: ∀ {α_1 : Type u_2} {f : α → α_1} {R : α_1 → α_1 → Prop} {l : List α},
  List.Pairwise R (List.map f l) ↔ List.Pairwise (fun a b => R (f a) (f b)) l

full_name: List.pairwise_append
code: theorem pairwise_append {l₁ l₂ : List α} :
    (l₁ ++ l₂).Pairwise R ↔ l₁.Pairwise R ∧ l₂.Pairwise R ∧ ∀ a ∈ l₁, ∀ b ∈ l₂, R a b 
goal: List.Pairwise R (l₁ ++ l₂) ↔ List.Pairwise R l₁ ∧ List.Pairwise R l₂ ∧ ∀ (a : α), a ∈ l₁ → ∀ (b : α), b ∈ l₂ → R a b

full_name: List.pairwise_reverse
code: theorem pairwise_reverse {l : List α} :
    l.reverse.Pairwise R ↔ l.Pairwise (fun a b => R b a) 
goal: List.Pairwise R l.reverse ↔ List.Pairwise (fun a b => R b a) l

full_name: List.Pairwise.imp
code: theorem Pairwise.imp {α R S} (H : ∀ {a b}, R a b → S a b) :
    ∀ {l : List α}, l.Pairwise R → l.Pairwise S
  
goal: List.Pairwise R l → List.Pairwise S l

full_name: List.replaceF_nil
code: theorem replaceF_nil : [].replaceF p = [] 
goal: ∀ {α : Type u_1} {p : α → Option α}, List.replaceF p [] = []

full_name: List.replaceF_cons
code: theorem replaceF_cons (a : α) (l : List α) :
    (a :: l).replaceF p = match p a with
      | none => a :: replaceF p l
      | some a' => a' :: l 
goal: List.replaceF p (a :: l) =
  match p a with
  | none => a :: List.replaceF p l
  | some a' => a' :: l

full_name: List.replaceF_cons_of_some
code: theorem replaceF_cons_of_some {l : List α} (p) (h : p a = some a') :
    (a :: l).replaceF p = a' :: l 
goal: List.replaceF p (a :: l) = a' :: l

full_name: List.replaceF_cons_of_none
code: theorem replaceF_cons_of_none {l : List α} (p) (h : p a = none) :
    (a :: l).replaceF p = a :: l.replaceF p 
goal: List.replaceF p (a :: l) = a :: List.replaceF p l

full_name: List.replaceF_of_forall_none
code: theorem replaceF_of_forall_none {l : List α} (h : ∀ a, a ∈ l → p a = none) : l.replaceF p = l 
goal: List.replaceF p l = l

full_name: List.exists_of_replaceF
code: theorem exists_of_replaceF : ∀ {l : List α} {a a'} (al : a ∈ l) (pa : p a = some a'),
    ∃ a a' l₁ l₂,
      (∀ b ∈ l₁, p b = none) ∧ p a = some a' ∧ l = l₁ ++ a :: l₂ ∧ l.replaceF p = l₁ ++ a' :: l₂
  
goal: ∃ a a' l₁ l₂, (∀ (b : α), b ∈ l₁ → p b = none) ∧ p a = some a' ∧ l = l₁ ++ a :: l₂ ∧ List.replaceF p l = l₁ ++ a' :: l₂

full_name: List.exists_or_eq_self_of_replaceF
code: theorem exists_or_eq_self_of_replaceF (p) (l : List α) :
    l.replaceF p = l ∨ ∃ a a' l₁ l₂,
      (∀ b ∈ l₁, p b = none) ∧ p a = some a' ∧ l = l₁ ++ a :: l₂ ∧ l.replaceF p = l₁ ++ a' :: l₂ 
goal: List.replaceF p l = l ∨
  ∃ a a' l₁ l₂,
    (∀ (b : α), b ∈ l₁ → p b = none) ∧ p a = some a' ∧ l = l₁ ++ a :: l₂ ∧ List.replaceF p l = l₁ ++ a' :: l₂

full_name: List.length_replaceF
code: @[simp] theorem length_replaceF : length (replaceF f l) = length l 
goal: ∀ {α : Type u_1} {f : α → Option α} {l : List α}, (List.replaceF f l).length = l.length

full_name: List.disjoint_symm
code: theorem disjoint_symm (d : Disjoint l₁ l₂) : Disjoint l₂ l₁ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Disjoint l₂ → l₂.Disjoint l₁

full_name: List.disjoint_comm
code: theorem disjoint_comm : Disjoint l₁ l₂ ↔ Disjoint l₂ l₁ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Disjoint l₂ ↔ l₂.Disjoint l₁

full_name: List.disjoint_left
code: theorem disjoint_left : Disjoint l₁ l₂ ↔ ∀ ⦃a⦄, a ∈ l₁ → a ∉ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Disjoint l₂ ↔ ∀ ⦃a : α⦄, a ∈ l₁ → ¬a ∈ l₂

full_name: List.disjoint_right
code: theorem disjoint_right : Disjoint l₁ l₂ ↔ ∀ ⦃a⦄, a ∈ l₂ → a ∉ l₁ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Disjoint l₂ ↔ ∀ ⦃a : α⦄, a ∈ l₂ → ¬a ∈ l₁

full_name: List.disjoint_iff_ne
code: theorem disjoint_iff_ne : Disjoint l₁ l₂ ↔ ∀ a ∈ l₁, ∀ b ∈ l₂, a ≠ b 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Disjoint l₂ ↔ ∀ (a : α), a ∈ l₁ → ∀ (b : α), b ∈ l₂ → a ≠ b

full_name: List.disjoint_of_subset_left
code: theorem disjoint_of_subset_left (ss : l₁ ⊆ l) (d : Disjoint l l₂) : Disjoint l₁ l₂ 
goal: ∀ {α : Type u_1} {l₁ l l₂ : List α}, l₁ ⊆ l → l.Disjoint l₂ → l₁.Disjoint l₂

full_name: List.disjoint_of_subset_right
code: theorem disjoint_of_subset_right (ss : l₂ ⊆ l) (d : Disjoint l₁ l) : Disjoint l₁ l₂ 
goal: ∀ {α : Type u_1} {l₂ l l₁ : List α}, l₂ ⊆ l → l₁.Disjoint l → l₁.Disjoint l₂

full_name: List.disjoint_of_disjoint_cons_left
code: theorem disjoint_of_disjoint_cons_left {l₁ l₂} : Disjoint (a :: l₁) l₂ → Disjoint l₁ l₂ 
goal: ∀ {α : Type u_1} {a : α} {l₁ l₂ : List α}, (a :: l₁).Disjoint l₂ → l₁.Disjoint l₂

full_name: List.disjoint_of_disjoint_cons_right
code: theorem disjoint_of_disjoint_cons_right {l₁ l₂} : Disjoint l₁ (a :: l₂) → Disjoint l₁ l₂ 
goal: ∀ {α : Type u_1} {a : α} {l₁ l₂ : List α}, l₁.Disjoint (a :: l₂) → l₁.Disjoint l₂

full_name: List.disjoint_nil_left
code: @[simp] theorem disjoint_nil_left (l : List α) : Disjoint [] l 
goal: [].Disjoint l

full_name: List.disjoint_nil_right
code: @[simp] theorem disjoint_nil_right (l : List α) : Disjoint l [] 
goal: l.Disjoint []

full_name: List.singleton_disjoint
code: @[simp 1100] theorem singleton_disjoint : Disjoint [a] l ↔ a ∉ l 
goal: ∀ {α : Type u_1} {a : α} {l : List α}, [a].Disjoint l ↔ ¬a ∈ l

full_name: List.disjoint_singleton
code: @[simp 1100] theorem disjoint_singleton : Disjoint l [a] ↔ a ∉ l 
goal: ∀ {α : Type u_1} {l : List α} {a : α}, l.Disjoint [a] ↔ ¬a ∈ l

full_name: List.disjoint_append_left
code: @[simp] theorem disjoint_append_left : Disjoint (l₁ ++ l₂) l ↔ Disjoint l₁ l ∧ Disjoint l₂ l 
goal: ∀ {α : Type u_1} {l₁ l₂ l : List α}, (l₁ ++ l₂).Disjoint l ↔ l₁.Disjoint l ∧ l₂.Disjoint l

full_name: List.disjoint_append_right
code: @[simp] theorem disjoint_append_right : Disjoint l (l₁ ++ l₂) ↔ Disjoint l l₁ ∧ Disjoint l l₂ 
goal: ∀ {α : Type u_1} {l l₁ l₂ : List α}, l.Disjoint (l₁ ++ l₂) ↔ l.Disjoint l₁ ∧ l.Disjoint l₂

full_name: List.disjoint_cons_left
code: @[simp] theorem disjoint_cons_left : Disjoint (a::l₁) l₂ ↔ (a ∉ l₂) ∧ Disjoint l₁ l₂ 
goal: ∀ {α : Type u_1} {a : α} {l₁ l₂ : List α}, (a :: l₁).Disjoint l₂ ↔ ¬a ∈ l₂ ∧ l₁.Disjoint l₂

full_name: List.disjoint_cons_right
code: @[simp] theorem disjoint_cons_right : Disjoint l₁ (a :: l₂) ↔ (a ∉ l₁) ∧ Disjoint l₁ l₂ 
goal: ∀ {α : Type u_1} {l₁ : List α} {a : α} {l₂ : List α}, l₁.Disjoint (a :: l₂) ↔ ¬a ∈ l₁ ∧ l₁.Disjoint l₂

full_name: List.disjoint_of_disjoint_append_left_left
code: theorem disjoint_of_disjoint_append_left_left (d : Disjoint (l₁ ++ l₂) l) : Disjoint l₁ l 
goal: ∀ {α : Type u_1} {l₁ l₂ l : List α}, (l₁ ++ l₂).Disjoint l → l₁.Disjoint l

full_name: List.disjoint_of_disjoint_append_left_right
code: theorem disjoint_of_disjoint_append_left_right (d : Disjoint (l₁ ++ l₂) l) : Disjoint l₂ l 
goal: ∀ {α : Type u_1} {l₁ l₂ l : List α}, (l₁ ++ l₂).Disjoint l → l₂.Disjoint l

full_name: List.disjoint_of_disjoint_append_right_left
code: theorem disjoint_of_disjoint_append_right_left (d : Disjoint l (l₁ ++ l₂)) : Disjoint l l₁ 
goal: ∀ {α : Type u_1} {l l₁ l₂ : List α}, l.Disjoint (l₁ ++ l₂) → l.Disjoint l₁

full_name: List.disjoint_of_disjoint_append_right_right
code: theorem disjoint_of_disjoint_append_right_right (d : Disjoint l (l₁ ++ l₂)) : Disjoint l l₂ 
goal: ∀ {α : Type u_1} {l l₁ l₂ : List α}, l.Disjoint (l₁ ++ l₂) → l.Disjoint l₂

full_name: List.foldl_hom
code: theorem foldl_hom (f : α₁ → α₂) (g₁ : α₁ → β → α₁) (g₂ : α₂ → β → α₂) (l : List β) (init : α₁)
    (H : ∀ x y, g₂ (f x) y = f (g₁ x y)) : l.foldl g₂ (f init) = f (l.foldl g₁ init) 
goal: List.foldl g₂ (f init) l = f (List.foldl g₁ init l)

full_name: List.foldr_hom
code: theorem foldr_hom (f : β₁ → β₂) (g₁ : α → β₁ → β₁) (g₂ : α → β₂ → β₂) (l : List α) (init : β₁)
    (H : ∀ x y, g₂ x (f y) = f (g₁ x y)) : l.foldr g₂ (f init) = f (l.foldr g₁ init) 
goal: List.foldr g₂ (f init) l = f (List.foldr g₁ init l)

full_name: List.union_def
code: theorem union_def (l₁ l₂ : List α)  : l₁ ∪ l₂ = foldr .insert l₂ l₁ 
goal: l₁ ∪ l₂ = List.foldr List.insert l₂ l₁

full_name: List.nil_union
code: @[simp] theorem nil_union (l : List α) : nil ∪ l = l 
goal: [] ∪ l = l

full_name: List.cons_union
code: @[simp] theorem cons_union (a : α) (l₁ l₂ : List α) :
    (a :: l₁) ∪ l₂ = (l₁ ∪ l₂).insert a 
goal: a :: l₁ ∪ l₂ = List.insert a (l₁ ∪ l₂)

full_name: List.mem_union_iff
code: @[simp] theorem mem_union_iff [LawfulBEq α] {x : α} {l₁ l₂ : List α} :
    x ∈ l₁ ∪ l₂ ↔ x ∈ l₁ ∨ x ∈ l₂ 
goal: x ∈ l₁ ∪ l₂ ↔ x ∈ l₁ ∨ x ∈ l₂

full_name: List.inter_def
code: theorem inter_def [BEq α] (l₁ l₂ : List α)  : l₁ ∩ l₂ = filter (elem · l₂) l₁ 
goal: l₁ ∩ l₂ = List.filter (fun x => List.elem x l₂) l₁

full_name: List.mem_inter_iff
code: @[simp] theorem mem_inter_iff [BEq α] [LawfulBEq α] {x : α} {l₁ l₂ : List α} :
    x ∈ l₁ ∩ l₂ ↔ x ∈ l₁ ∧ x ∈ l₂ 
goal: x ∈ l₁ ∩ l₂ ↔ x ∈ l₁ ∧ x ∈ l₂

full_name: List.pair_mem_product
code: /-- List.prod satisfies a specification of cartesian product on lists. -/
@[simp]
theorem pair_mem_product {xs : List α} {ys : List β} {x : α} {y : β} :
    (x, y) ∈ product xs ys ↔ x ∈ xs ∧ y ∈ ys 
goal: (x, y) ∈ xs.product ys ↔ x ∈ xs ∧ y ∈ ys

full_name: List.leftpad_length
code: /-- The length of the List returned by `List.leftpad n a l` is equal
  to the larger of `n` and `l.length` -/
@[simp]
theorem leftpad_length (n : Nat) (a : α) (l : List α) :
    (leftpad n a l).length = max n l.length 
goal: (List.leftpad n a l).length = max n l.length

full_name: List.leftpad_prefix
code: theorem leftpad_prefix (n : Nat) (a : α) (l : List α) :
    replicate (n - length l) a <+: leftpad n a l 
goal: List.replicate (n - l.length) a <+: List.leftpad n a l

full_name: List.leftpad_suffix
code: theorem leftpad_suffix (n : Nat) (a : α) (l : List α) : l <:+ (leftpad n a l) 
goal: l <:+ List.leftpad n a l

full_name: List.forIn_eq_forIn
code: @[simp] theorem forIn_eq_forIn [Monad m] : @List.forIn α β m _ = forIn 
goal: List.forIn = forIn

full_name: List.forIn_eq_bindList
code: theorem forIn_eq_bindList [Monad m] [LawfulMonad m]
    (f : α → β → m (ForInStep β)) (l : List α) (init : β) :
    forIn l init f = ForInStep.run <$> (ForInStep.yield init).bindList f l 
goal: forIn l init f = ForInStep.run <$> ForInStep.bindList f l (ForInStep.yield init)

full_name: List.forM_append
code: @[simp] theorem forM_append [Monad m] [LawfulMonad m] (l₁ l₂ : List α) (f : α → m PUnit) :
    (l₁ ++ l₂).forM f = (do l₁.forM f; l₂.forM f) 
goal: (l₁ ++ l₂).forM f = do
  l₁.forM f
  l₂.forM f

full_name: List.diff_nil
code: @[simp] theorem diff_nil (l : List α) : l.diff [] = l 
goal: l.diff [] = l

full_name: List.diff_cons
code: @[simp] theorem diff_cons (l₁ l₂ : List α) (a : α) : l₁.diff (a :: l₂) = (l₁.erase a).diff l₂ 
goal: l₁.diff (a :: l₂) = (l₁.erase a).diff l₂

full_name: List.diff_cons_right
code: theorem diff_cons_right (l₁ l₂ : List α) (a : α) : l₁.diff (a :: l₂) = (l₁.diff l₂).erase a 
goal: l₁.diff (a :: l₂) = (l₁.diff l₂).erase a

full_name: List.diff_erase
code: theorem diff_erase (l₁ l₂ : List α) (a : α) : (l₁.diff l₂).erase a = (l₁.erase a).diff l₂ 
goal: (l₁.diff l₂).erase a = (l₁.erase a).diff l₂

full_name: List.nil_diff
code: @[simp] theorem nil_diff (l : List α) : [].diff l = [] 
goal: [].diff l = []

full_name: List.cons_diff
code: theorem cons_diff (a : α) (l₁ l₂ : List α) :
    (a :: l₁).diff l₂ = if a ∈ l₂ then l₁.diff (l₂.erase a) else a :: l₁.diff l₂ 
goal: (a :: l₁).diff l₂ = if a ∈ l₂ then l₁.diff (l₂.erase a) else a :: l₁.diff l₂

full_name: List.cons_diff_of_mem
code: theorem cons_diff_of_mem {a : α} {l₂ : List α} (h : a ∈ l₂) (l₁ : List α) :
    (a :: l₁).diff l₂ = l₁.diff (l₂.erase a) 
goal: (a :: l₁).diff l₂ = l₁.diff (l₂.erase a)

full_name: List.cons_diff_of_not_mem
code: theorem cons_diff_of_not_mem {a : α} {l₂ : List α} (h : a ∉ l₂) (l₁ : List α) :
    (a :: l₁).diff l₂ = a :: l₁.diff l₂ 
goal: (a :: l₁).diff l₂ = a :: l₁.diff l₂

full_name: List.diff_eq_foldl
code: theorem diff_eq_foldl : ∀ l₁ l₂ : List α, l₁.diff l₂ = foldl List.erase l₁ l₂
  
goal: l₁.diff l₂ = List.foldl List.erase l₁ l₂

full_name: List.diff_append
code: @[simp] theorem diff_append (l₁ l₂ l₃ : List α) : l₁.diff (l₂ ++ l₃) = (l₁.diff l₂).diff l₃ 
goal: l₁.diff (l₂ ++ l₃) = (l₁.diff l₂).diff l₃

full_name: List.diff_sublist
code: theorem diff_sublist : ∀ l₁ l₂ : List α, l₁.diff l₂ <+ l₁
  
goal: l₁.diff l₂ <+ l₁

full_name: List.diff_subset
code: theorem diff_subset (l₁ l₂ : List α) : l₁.diff l₂ ⊆ l₁ 
goal: l₁.diff l₂ ⊆ l₁

full_name: List.mem_diff_of_mem
code: theorem mem_diff_of_mem {a : α} : ∀ {l₁ l₂ : List α}, a ∈ l₁ → a ∉ l₂ → a ∈ l₁.diff l₂
  
goal: a ∈ l₁ → ¬a ∈ l₂ → a ∈ l₁.diff l₂

full_name: List.Sublist.diff_right
code: theorem Sublist.diff_right : ∀ {l₁ l₂ l₃ : List α}, l₁ <+ l₂ → l₁.diff l₃ <+ l₂.diff l₃
  
goal: l₁ <+ l₂ → l₁.diff l₃ <+ l₂.diff l₃

full_name: List.Sublist.erase_diff_erase_sublist
code: theorem Sublist.erase_diff_erase_sublist {a : α} :
    ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → (l₂.erase a).diff (l₁.erase a) <+ l₂.diff l₁
  
goal: l₁ <+ l₂ → (l₂.erase a).diff (l₁.erase a) <+ l₂.diff l₁

full_name: List.prefix_append
code: @[simp] theorem prefix_append (l₁ l₂ : List α) : l₁ <+: l₁ ++ l₂ 
goal: l₁ <+: l₁ ++ l₂

full_name: List.suffix_append
code: @[simp] theorem suffix_append (l₁ l₂ : List α) : l₂ <:+ l₁ ++ l₂ 
goal: l₂ <:+ l₁ ++ l₂

full_name: List.infix_append
code: theorem infix_append (l₁ l₂ l₃ : List α) : l₂ <:+: l₁ ++ l₂ ++ l₃ 
goal: l₂ <:+: l₁ ++ l₂ ++ l₃

full_name: List.infix_append'
code: @[simp] theorem infix_append' (l₁ l₂ l₃ : List α) : l₂ <:+: l₁ ++ (l₂ ++ l₃) 
goal: l₂ <:+: l₁ ++ (l₂ ++ l₃)

full_name: List.IsPrefix.isInfix
code: theorem IsPrefix.isInfix : l₁ <+: l₂ → l₁ <:+: l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+: l₂ → l₁ <:+: l₂

full_name: List.IsSuffix.isInfix
code: theorem IsSuffix.isInfix : l₁ <:+ l₂ → l₁ <:+: l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+ l₂ → l₁ <:+: l₂

full_name: List.nil_prefix
code: theorem nil_prefix (l : List α) : [] <+: l 
goal: [] <+: l

full_name: List.nil_suffix
code: theorem nil_suffix (l : List α) : [] <:+ l 
goal: [] <:+ l

full_name: List.nil_infix
code: theorem nil_infix (l : List α) : [] <:+: l 
goal: [] <:+: l

full_name: List.prefix_refl
code: theorem prefix_refl (l : List α) : l <+: l 
goal: l <+: l

full_name: List.suffix_refl
code: theorem suffix_refl (l : List α) : l <:+ l 
goal: l <:+ l

full_name: List.infix_refl
code: theorem infix_refl (l : List α) : l <:+: l 
goal: l <:+: l

full_name: List.suffix_cons
code: @[simp] theorem suffix_cons (a : α) : ∀ l, l <:+ a :: l 
goal: l <:+ a :: l

full_name: List.infix_cons
code: theorem infix_cons : l₁ <:+: l₂ → l₁ <:+: a :: l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α} {a : α}, l₁ <:+: l₂ → l₁ <:+: a :: l₂

full_name: List.infix_concat
code: theorem infix_concat : l₁ <:+: l₂ → l₁ <:+: concat l₂ a 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α} {a : α}, l₁ <:+: l₂ → l₁ <:+: l₂.concat a

full_name: List.IsPrefix.trans
code: theorem IsPrefix.trans : ∀ {l₁ l₂ l₃ : List α}, l₁ <+: l₂ → l₂ <+: l₃ → l₁ <+: l₃
  
goal: l₁ <+: l₂ → l₂ <+: l₃ → l₁ <+: l₃

full_name: List.IsSuffix.trans
code: theorem IsSuffix.trans : ∀ {l₁ l₂ l₃ : List α}, l₁ <:+ l₂ → l₂ <:+ l₃ → l₁ <:+ l₃
  
goal: l₁ <:+ l₂ → l₂ <:+ l₃ → l₁ <:+ l₃

full_name: List.IsInfix.trans
code: theorem IsInfix.trans : ∀ {l₁ l₂ l₃ : List α}, l₁ <:+: l₂ → l₂ <:+: l₃ → l₁ <:+: l₃
  
goal: l₁ <:+: l₂ → l₂ <:+: l₃ → l₁ <:+: l₃

full_name: List.IsInfix.sublist
code: protected theorem IsInfix.sublist : l₁ <:+: l₂ → l₁ <+ l₂
  
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+: l₂ → l₁ <+ l₂

full_name: List.IsInfix.subset
code: protected theorem IsInfix.subset (hl : l₁ <:+: l₂) : l₁ ⊆ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+: l₂ → l₁ ⊆ l₂

full_name: List.IsPrefix.sublist
code: protected theorem IsPrefix.sublist (h : l₁ <+: l₂) : l₁ <+ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+: l₂ → l₁ <+ l₂

full_name: List.IsPrefix.subset
code: protected theorem IsPrefix.subset (hl : l₁ <+: l₂) : l₁ ⊆ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+: l₂ → l₁ ⊆ l₂

full_name: List.IsSuffix.sublist
code: protected theorem IsSuffix.sublist (h : l₁ <:+ l₂) : l₁ <+ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+ l₂ → l₁ <+ l₂

full_name: List.IsSuffix.subset
code: protected theorem IsSuffix.subset (hl : l₁ <:+ l₂) : l₁ ⊆ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+ l₂ → l₁ ⊆ l₂

full_name: List.reverse_suffix
code: @[simp] theorem reverse_suffix : reverse l₁ <:+ reverse l₂ ↔ l₁ <+: l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.reverse <:+ l₂.reverse ↔ l₁ <+: l₂

full_name: List.reverse_prefix
code: @[simp] theorem reverse_prefix : reverse l₁ <+: reverse l₂ ↔ l₁ <:+ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.reverse <+: l₂.reverse ↔ l₁ <:+ l₂

full_name: List.reverse_infix
code: @[simp] theorem reverse_infix : reverse l₁ <:+: reverse l₂ ↔ l₁ <:+: l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.reverse <:+: l₂.reverse ↔ l₁ <:+: l₂

full_name: List.IsInfix.length_le
code: theorem IsInfix.length_le (h : l₁ <:+: l₂) : l₁.length ≤ l₂.length 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+: l₂ → l₁.length ≤ l₂.length

full_name: List.IsPrefix.length_le
code: theorem IsPrefix.length_le (h : l₁ <+: l₂) : l₁.length ≤ l₂.length 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+: l₂ → l₁.length ≤ l₂.length

full_name: List.IsSuffix.length_le
code: theorem IsSuffix.length_le (h : l₁ <:+ l₂) : l₁.length ≤ l₂.length 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+ l₂ → l₁.length ≤ l₂.length

full_name: List.infix_nil
code: @[simp] theorem infix_nil : l <:+: [] ↔ l = [] 
goal: ∀ {α : Type u_1} {l : List α}, l <:+: [] ↔ l = []

full_name: List.prefix_nil
code: @[simp] theorem prefix_nil : l <+: [] ↔ l = [] 
goal: ∀ {α : Type u_1} {l : List α}, l <+: [] ↔ l = []

full_name: List.suffix_nil
code: @[simp] theorem suffix_nil : l <:+ [] ↔ l = [] 
goal: ∀ {α : Type u_1} {l : List α}, l <:+ [] ↔ l = []

full_name: List.infix_iff_prefix_suffix
code: theorem infix_iff_prefix_suffix (l₁ l₂ : List α) : l₁ <:+: l₂ ↔ ∃ t, l₁ <+: t ∧ t <:+ l₂ 
goal: l₁ <:+: l₂ ↔ ∃ t, l₁ <+: t ∧ t <:+ l₂

full_name: List.IsInfix.eq_of_length
code: theorem IsInfix.eq_of_length (h : l₁ <:+: l₂) : l₁.length = l₂.length → l₁ = l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+: l₂ → l₁.length = l₂.length → l₁ = l₂

full_name: List.IsPrefix.eq_of_length
code: theorem IsPrefix.eq_of_length (h : l₁ <+: l₂) : l₁.length = l₂.length → l₁ = l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <+: l₂ → l₁.length = l₂.length → l₁ = l₂

full_name: List.IsSuffix.eq_of_length
code: theorem IsSuffix.eq_of_length (h : l₁ <:+ l₂) : l₁.length = l₂.length → l₁ = l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+ l₂ → l₁.length = l₂.length → l₁ = l₂

full_name: List.prefix_of_prefix_length_le
code: theorem prefix_of_prefix_length_le :
    ∀ {l₁ l₂ l₃ : List α}, l₁ <+: l₃ → l₂ <+: l₃ → length l₁ ≤ length l₂ → l₁ <+: l₂
  
goal: l₁ <+: l₃ → l₂ <+: l₃ → l₁.length ≤ l₂.length → l₁ <+: l₂

full_name: List.prefix_or_prefix_of_prefix
code: theorem prefix_or_prefix_of_prefix (h₁ : l₁ <+: l₃) (h₂ : l₂ <+: l₃) : l₁ <+: l₂ ∨ l₂ <+: l₁ 
goal: ∀ {α : Type u_1} {l₁ l₃ l₂ : List α}, l₁ <+: l₃ → l₂ <+: l₃ → l₁ <+: l₂ ∨ l₂ <+: l₁

full_name: List.suffix_of_suffix_length_le
code: theorem suffix_of_suffix_length_le
    (h₁ : l₁ <:+ l₃) (h₂ : l₂ <:+ l₃) (ll : length l₁ ≤ length l₂) : l₁ <:+ l₂ 
goal: ∀ {α : Type u_1} {l₁ l₃ l₂ : List α}, l₁ <:+ l₃ → l₂ <:+ l₃ → l₁.length ≤ l₂.length → l₁ <:+ l₂

full_name: List.suffix_or_suffix_of_suffix
code: theorem suffix_or_suffix_of_suffix (h₁ : l₁ <:+ l₃) (h₂ : l₂ <:+ l₃) : l₁ <:+ l₂ ∨ l₂ <:+ l₁ 
goal: ∀ {α : Type u_1} {l₁ l₃ l₂ : List α}, l₁ <:+ l₃ → l₂ <:+ l₃ → l₁ <:+ l₂ ∨ l₂ <:+ l₁

full_name: List.suffix_cons_iff
code: theorem suffix_cons_iff : l₁ <:+ a :: l₂ ↔ l₁ = a :: l₂ ∨ l₁ <:+ l₂ 
goal: ∀ {α : Type u_1} {l₁ : List α} {a : α} {l₂ : List α}, l₁ <:+ a :: l₂ ↔ l₁ = a :: l₂ ∨ l₁ <:+ l₂

full_name: List.infix_cons_iff
code: theorem infix_cons_iff : l₁ <:+: a :: l₂ ↔ l₁ <+: a :: l₂ ∨ l₁ <:+: l₂ 
goal: ∀ {α : Type u_1} {l₁ : List α} {a : α} {l₂ : List α}, l₁ <:+: a :: l₂ ↔ l₁ <+: a :: l₂ ∨ l₁ <:+: l₂

full_name: List.infix_of_mem_join
code: theorem infix_of_mem_join : ∀ {L : List (List α)}, l ∈ L → l <:+: join L
  
goal: l ∈ L → l <:+: L.join

full_name: List.prefix_append_right_inj
code: theorem prefix_append_right_inj (l) : l ++ l₁ <+: l ++ l₂ ↔ l₁ <+: l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α} (l : List α), l ++ l₁ <+: l ++ l₂ ↔ l₁ <+: l₂

full_name: List.prefix_cons_inj
code: @[simp]
theorem prefix_cons_inj (a) : a :: l₁ <+: a :: l₂ ↔ l₁ <+: l₂ 
goal: ∀ {α : Type u_1} {l₁ l₂ : List α} (a : α), a :: l₁ <+: a :: l₂ ↔ l₁ <+: l₂

full_name: List.take_prefix
code: theorem take_prefix (n) (l : List α) : take n l <+: l 
goal: List.take n l <+: l

full_name: List.drop_suffix
code: theorem drop_suffix (n) (l : List α) : drop n l <:+ l 
goal: List.drop n l <:+ l

full_name: List.take_sublist
code: theorem take_sublist (n) (l : List α) : take n l <+ l 
goal: List.take n l <+ l

full_name: List.drop_sublist
code: theorem drop_sublist (n) (l : List α) : drop n l <+ l 
goal: List.drop n l <+ l

full_name: List.take_subset
code: theorem take_subset (n) (l : List α) : take n l ⊆ l 
goal: List.take n l ⊆ l

full_name: List.drop_subset
code: theorem drop_subset (n) (l : List α) : drop n l ⊆ l 
goal: List.drop n l ⊆ l

full_name: List.mem_of_mem_take
code: theorem mem_of_mem_take {l : List α} (h : a ∈ l.take n) : a ∈ l 
goal: a ∈ l

full_name: List.IsPrefix.filter
code: theorem IsPrefix.filter (p : α → Bool) ⦃l₁ l₂ : List α⦄ (h : l₁ <+: l₂) :
    l₁.filter p <+: l₂.filter p 
goal: List.filter p l₁ <+: List.filter p l₂

full_name: List.IsSuffix.filter
code: theorem IsSuffix.filter (p : α → Bool) ⦃l₁ l₂ : List α⦄ (h : l₁ <:+ l₂) :
    l₁.filter p <:+ l₂.filter p 
goal: List.filter p l₁ <:+ List.filter p l₂

full_name: List.IsInfix.filter
code: theorem IsInfix.filter (p : α → Bool) ⦃l₁ l₂ : List α⦄ (h : l₁ <:+: l₂) :
    l₁.filter p <:+: l₂.filter p 
goal: List.filter p l₁ <:+: List.filter p l₂

full_name: List.mem_of_mem_drop
code: theorem mem_of_mem_drop {n} {l : List α} (h : a ∈ l.drop n) : a ∈ l 
goal: a ∈ l

full_name: List.disjoint_take_drop
code: theorem disjoint_take_drop : ∀ {l : List α}, l.Nodup → m ≤ n → Disjoint (l.take m) (l.drop n)
  
goal: l.Nodup → m ≤ n → (List.take m l).Disjoint (List.drop n l)

full_name: List.chain_cons
code: @[simp]
theorem chain_cons {a b : α} {l : List α} : Chain R a (b :: l) ↔ R a b ∧ Chain R b l 
goal: List.Chain R a (b :: l) ↔ R a b ∧ List.Chain R b l

full_name: List.rel_of_chain_cons
code: theorem rel_of_chain_cons {a b : α} {l : List α} (p : Chain R a (b :: l)) : R a b 
goal: R a b

full_name: List.chain_of_chain_cons
code: theorem chain_of_chain_cons {a b : α} {l : List α} (p : Chain R a (b :: l)) : Chain R b l 
goal: List.Chain R b l

full_name: List.Chain.imp'
code: theorem Chain.imp' {R S : α → α → Prop} (HRS : ∀ ⦃a b⦄, R a b → S a b) {a b : α}
    (Hab : ∀ ⦃c⦄, R a c → S b c) {l : List α} (p : Chain R a l) : Chain S b l 
goal: List.Chain S b l

full_name: List.Chain.imp
code: theorem Chain.imp {R S : α → α → Prop} (H : ∀ a b, R a b → S a b) {a : α} {l : List α}
    (p : Chain R a l) : Chain S a l 
goal: List.Chain S a l

full_name: List.Pairwise.chain
code: protected theorem Pairwise.chain (p : Pairwise R (a :: l)) : Chain R a l 
goal: ∀ {α : Type u_1} {R : α → α → Prop} {a : α} {l : List α}, List.Pairwise R (a :: l) → List.Chain R a l

full_name: List.range'_succ
code: theorem range'_succ (s n step) : range' s (n + 1) step = s :: range' (s + step) n step 
goal: List.range' s (n + 1) step = s :: List.range' (s + step) n step

full_name: List.length_range'
code: @[simp] theorem length_range' (s step) : ∀ n : Nat, length (range' s n step) = n
  
goal: (List.range' s n step).length = n

full_name: List.range'_eq_nil
code: @[simp] theorem range'_eq_nil : range' s n step = [] ↔ n = 0 
goal: List.range' s n step = [] ↔ n = 0

full_name: List.mem_range'
code: theorem mem_range' : ∀{n}, m ∈ range' s n step ↔ ∃ i < n, m = s + step * i
  
goal: m ∈ List.range' s n step ↔ ∃ i, i < n ∧ m = s + step * i

full_name: List.mem_range'_1
code: @[simp] theorem mem_range'_1 : m ∈ range' s n ↔ s ≤ m ∧ m < s + n 
goal: m ∈ List.range' s n ↔ s ≤ m ∧ m < s + n

full_name: List.map_add_range'
code: @[simp]
theorem map_add_range' (a) : ∀ s n step, map (a + ·) (range' s n step) = range' (a + s) n step
  
goal: List.map (fun x => a + x) (List.range' s n step) = List.range' (a + s) n step

full_name: List.map_sub_range'
code: theorem map_sub_range' (a s n : Nat) (h : a ≤ s) :
    map (· - a) (range' s n step) = range' (s - a) n step 
goal: List.map (fun x => x - a) (List.range' s n step) = List.range' (s - a) n step

full_name: List.chain_succ_range'
code: theorem chain_succ_range' : ∀ s n step : Nat,
    Chain (fun a b => b = a + step) s (range' (s + step) n step)
  
goal: List.Chain (fun a b => b = a + step) s (List.range' (s + step) n step)

full_name: List.chain_lt_range'
code: theorem chain_lt_range' (s n : Nat) {step} (h : 0 < step) :
    Chain (· < ·) s (range' (s + step) n step) 
goal: List.Chain (fun x x_1 => x < x_1) s (List.range' (s + step) n step)

full_name: List.range'_append
code: theorem range'_append : ∀ s m n step : Nat,
    range' s m step ++ range' (s + step * m) n step = range' s (n + m) step
  
goal: List.range' s m step ++ List.range' (s + step * m) n step = List.range' s (n + m) step

full_name: List.range'_append_1
code: @[simp] theorem range'_append_1 (s m n : Nat) :
    range' s m ++ range' (s + m) n = range' s (n + m) 
goal: List.range' s m ++ List.range' (s + m) n = List.range' s (n + m)

full_name: List.range'_sublist_right
code: theorem range'_sublist_right {s m n : Nat} : range' s m step <+ range' s n step ↔ m ≤ n 
goal: List.range' s m step <+ List.range' s n step ↔ m ≤ n

full_name: List.range'_subset_right
code: theorem range'_subset_right {s m n : Nat} (step0 : 0 < step) :
    range' s m step ⊆ range' s n step ↔ m ≤ n 
goal: List.range' s m step ⊆ List.range' s n step ↔ m ≤ n

full_name: List.range'_subset_right_1
code: theorem range'_subset_right_1 {s m n : Nat} : range' s m ⊆ range' s n ↔ m ≤ n 
goal: List.range' s m ⊆ List.range' s n ↔ m ≤ n

full_name: List.getElem?_range'
code: theorem getElem?_range' (s step) :
    ∀ {m n : Nat}, m < n → (range' s n step)[m]? = some (s + step * m)
  
goal: m < n → (List.range' s n step)[m]? = some (s + step * m)

full_name: List.getElem_range'
code: @[simp] theorem getElem_range' {n m step} (i) (H : i < (range' n m step).length) :
    (range' n m step)[i] = n + step * i 
goal: (List.range' n m step)[i] = n + step * i

full_name: List.get?_range'
code: @[deprecated getElem?_range' (since := "2024-06-12")]
theorem get?_range' (s step) {m n : Nat} (h : m < n) :
    get? (range' s n step) m = some (s + step * m) 
goal: (List.range' s n step).get? m = some (s + step * m)

full_name: List.get_range'
code: @[deprecated getElem_range' (since := "2024-06-12")]
theorem get_range' {n m step} (i) (H : i < (range' n m step).length) :
    get (range' n m step) ⟨i, H⟩ = n + step * i 
goal: (List.range' n m step).get ⟨i, H⟩ = n + step * i

full_name: List.range'_concat
code: theorem range'_concat (s n : Nat) : range' s (n + 1) step = range' s n step ++ [s + step * n] 
goal: List.range' s (n + 1) step = List.range' s n step ++ [s + step * n]

full_name: List.range'_1_concat
code: theorem range'_1_concat (s n : Nat) : range' s (n + 1) = range' s n ++ [s + n] 
goal: List.range' s (n + 1) = List.range' s n ++ [s + n]

full_name: List.range_loop_range'
code: theorem range_loop_range' : ∀ s n : Nat, range.loop s (range' s n) = range' 0 (n + s)
  
goal: List.range.loop s (List.range' s n) = List.range' 0 (n + s)

full_name: List.range_eq_range'
code: theorem range_eq_range' (n : Nat) : range n = range' 0 n 
goal: List.range n = List.range' 0 n

full_name: List.range_succ_eq_map
code: theorem range_succ_eq_map (n : Nat) : range (n + 1) = 0 :: map succ (range n) 
goal: List.range (n + 1) = 0 :: List.map Nat.succ (List.range n)

full_name: List.range'_eq_map_range
code: theorem range'_eq_map_range (s n : Nat) : range' s n = map (s + ·) (range n) 
goal: List.range' s n = List.map (fun x => s + x) (List.range n)

full_name: List.length_range
code: @[simp] theorem length_range (n : Nat) : length (range n) = n 
goal: (List.range n).length = n

full_name: List.range_eq_nil
code: @[simp] theorem range_eq_nil {n : Nat} : range n = [] ↔ n = 0 
goal: List.range n = [] ↔ n = 0

full_name: List.range_sublist
code: @[simp]
theorem range_sublist {m n : Nat} : range m <+ range n ↔ m ≤ n 
goal: List.range m <+ List.range n ↔ m ≤ n

full_name: List.range_subset
code: @[simp]
theorem range_subset {m n : Nat} : range m ⊆ range n ↔ m ≤ n 
goal: List.range m ⊆ List.range n ↔ m ≤ n

full_name: List.mem_range
code: @[simp]
theorem mem_range {m n : Nat} : m ∈ range n ↔ m < n 
goal: m ∈ List.range n ↔ m < n

full_name: List.not_mem_range_self
code: theorem not_mem_range_self {n : Nat} : n ∉ range n 
goal: ¬n ∈ List.range n

full_name: List.self_mem_range_succ
code: theorem self_mem_range_succ (n : Nat) : n ∈ range (n + 1) 
goal: n ∈ List.range (n + 1)

full_name: List.getElem?_range
code: theorem getElem?_range {m n : Nat} (h : m < n) : (range n)[m]? = some m 
goal: (List.range n)[m]? = some m

full_name: List.getElem_range
code: @[simp] theorem getElem_range {n : Nat} (m) (h : m < (range n).length) : (range n)[m] = m 
goal: (List.range n)[m] = m

full_name: List.get?_range
code: @[deprecated getElem?_range (since := "2024-06-12")]
theorem get?_range {m n : Nat} (h : m < n) : get? (range n) m = some m 
goal: (List.range n).get? m = some m

full_name: List.get_range
code: @[deprecated getElem_range (since := "2024-06-12")]
theorem get_range {n} (i) (H : i < (range n).length) : get (range n) ⟨i, H⟩ = i 
goal: (List.range n).get ⟨i, H⟩ = i

full_name: List.range_succ
code: theorem range_succ (n : Nat) : range (succ n) = range n ++ [n] 
goal: List.range n.succ = List.range n ++ [n]

full_name: List.range_add
code: theorem range_add (a b : Nat) : range (a + b) = range a ++ (range b).map (a + ·) 
goal: List.range (a + b) = List.range a ++ List.map (fun x => a + x) (List.range b)

full_name: List.iota_eq_reverse_range'
code: theorem iota_eq_reverse_range' : ∀ n : Nat, iota n = reverse (range' 1 n)
  
goal: List.iota n = (List.range' 1 n).reverse

full_name: List.length_iota
code: @[simp] theorem length_iota (n : Nat) : length (iota n) = n 
goal: (List.iota n).length = n

full_name: List.mem_iota
code: @[simp]
theorem mem_iota {m n : Nat} : m ∈ iota n ↔ 1 ≤ m ∧ m ≤ n 
goal: m ∈ List.iota n ↔ 1 ≤ m ∧ m ≤ n

full_name: List.reverse_range'
code: theorem reverse_range' : ∀ s n : Nat, reverse (range' s n) = map (s + n - 1 - ·) (range n)
  
goal: (List.range' s n).reverse = List.map (fun x => s + n - 1 - x) (List.range n)

full_name: List.enumFrom_map_fst
code: @[simp] theorem enumFrom_map_fst (n) :
    ∀ (l : List α), map Prod.fst (enumFrom n l) = range' n l.length
  
goal: List.map Prod.fst (List.enumFrom n l) = List.range' n l.length

full_name: List.enum_map_fst
code: @[simp] theorem enum_map_fst (l : List α) : map Prod.fst (enum l) = range l.length 
goal: List.map Prod.fst l.enum = List.range l.length

full_name: List.foldrIdx_start
code: theorem foldrIdx_start :
    (xs : List α).foldrIdx f i s = (xs : List α).foldrIdx (fun i => f (i + s)) i 
goal: ∀ {α_1 : Sort u_2} {f : Nat → α → α_1 → α_1} {i : α_1} {s : Nat},
  List.foldrIdx f i xs s = List.foldrIdx (fun i => f (i + s)) i xs

full_name: List.foldrIdx_cons
code: @[simp] theorem foldrIdx_cons :
    (x :: xs : List α).foldrIdx f i s = f s x (foldrIdx f i xs (s + 1)) 
goal: ∀ {α_1 : Sort u_2} {f : Nat → α → α_1 → α_1} {i : α_1} {s : Nat},
  List.foldrIdx f i (x :: xs) s = f s x (List.foldrIdx f i xs (s + 1))

full_name: List.findIdxs_cons_aux
code: theorem findIdxs_cons_aux (p : α → Bool) :
    foldrIdx (fun i a is => if p a = true then (i + 1) :: is else is) [] xs s =
      map (· + 1) (foldrIdx (fun i a is => if p a = true then i :: is else is) [] xs s) 
goal: List.foldrIdx (fun i a is => if p a = true then (i + 1) :: is else is) [] xs s =
  List.map (fun x => x + 1) (List.foldrIdx (fun i a is => if p a = true then i :: is else is) [] xs s)

full_name: List.findIdxs_cons
code: theorem findIdxs_cons :
    (x :: xs : List α).findIdxs p =
      bif p x then 0 :: (xs.findIdxs p).map (· + 1) else (xs.findIdxs p).map (· + 1) 
goal: List.findIdxs p (x :: xs) =
  bif p x then 0 :: List.map (fun x => x + 1) (List.findIdxs p xs) else List.map (fun x => x + 1) (List.findIdxs p xs)

full_name: List.indexesOf_nil
code: @[simp] theorem indexesOf_nil [BEq α] : ([] : List α).indexesOf x = [] 
goal: List.indexesOf x [] = []

full_name: List.indexesOf_cons
code: theorem indexesOf_cons [BEq α] : (x :: xs : List α).indexesOf y =
    bif x == y then 0 :: (xs.indexesOf y).map (· + 1) else (xs.indexesOf y).map (· + 1) 
goal: List.indexesOf y (x :: xs) =
  bif x == y then 0 :: List.map (fun x => x + 1) (List.indexesOf y xs)
  else List.map (fun x => x + 1) (List.indexesOf y xs)

full_name: List.indexOf_nil
code: @[simp] theorem indexOf_nil [BEq α] : ([] : List α).indexOf x = 0 
goal: List.indexOf x [] = 0

full_name: List.indexOf_cons
code: theorem indexOf_cons [BEq α] :
    (x :: xs : List α).indexOf y = bif x == y then 0 else xs.indexOf y + 1 
goal: List.indexOf y (x :: xs) = bif x == y then 0 else List.indexOf y xs + 1

full_name: List.indexOf_mem_indexesOf
code: theorem indexOf_mem_indexesOf [BEq α] [LawfulBEq α] {xs : List α} (m : x ∈ xs) :
    xs.indexOf x ∈ xs.indexesOf x 
goal: List.indexOf x xs ∈ List.indexesOf x xs

full_name: List.merge_loop_nil_left
code: theorem merge_loop_nil_left (s : α → α → Bool) (r t) :
    merge.loop s [] r t = reverseAux t r 
goal: List.merge.loop s [] r t = t.reverseAux r

full_name: List.merge_loop_nil_right
code: theorem merge_loop_nil_right (s : α → α → Bool) (l t) :
    merge.loop s l [] t = reverseAux t l 
goal: List.merge.loop s l [] t = t.reverseAux l

full_name: List.merge_loop
code: theorem merge_loop (s : α → α → Bool) (l r t) :
    merge.loop s l r t = reverseAux t (merge s l r) 
goal: List.merge.loop s l r t = t.reverseAux (List.merge s l r)

full_name: List.merge_nil
code: @[simp] theorem merge_nil (s : α → α → Bool) (l) : merge s l [] = l 
goal: List.merge s l [] = l

full_name: List.nil_merge
code: @[simp] theorem nil_merge (s : α → α → Bool) (r) : merge s [] r = r 
goal: List.merge s [] r = r

full_name: List.cons_merge_cons
code: theorem cons_merge_cons (s : α → α → Bool) (a b l r) :
  merge s (a::l) (b::r) = if s a b then a :: merge s l (b::r) else b :: merge s (a::l) r 
goal: List.merge s (a :: l) (b :: r) = if s a b = true then a :: List.merge s l (b :: r) else b :: List.merge s (a :: l) r

full_name: List.cons_merge_cons_pos
code: @[simp] theorem cons_merge_cons_pos (s : α → α → Bool) (l r) (h : s a b) :
    merge s (a::l) (b::r) = a :: merge s l (b::r) 
goal: List.merge s (a :: l) (b :: r) = a :: List.merge s l (b :: r)

full_name: List.cons_merge_cons_neg
code: @[simp] theorem cons_merge_cons_neg (s : α → α → Bool) (l r) (h : ¬ s a b) :
    merge s (a::l) (b::r) = b :: merge s (a::l) r 
goal: List.merge s (a :: l) (b :: r) = b :: List.merge s (a :: l) r

full_name: List.length_merge
code: @[simp] theorem length_merge (s : α → α → Bool) (l r) :
    (merge s l r).length = l.length + r.length 
goal: (List.merge s l r).length = l.length + r.length

full_name: List.mem_merge
code: @[simp]
theorem mem_merge {s : α → α → Bool} : x ∈ merge s l r ↔ x ∈ l ∨ x ∈ r 
goal: x ∈ List.merge s l r ↔ x ∈ l ∨ x ∈ r

full_name: List.mem_merge_left
code: theorem mem_merge_left (s : α → α → Bool) (h : x ∈ l) : x ∈ merge s l r 
goal: x ∈ List.merge s l r

full_name: List.mem_merge_right
code: theorem mem_merge_right (s : α → α → Bool) (h : x ∈ r) : x ∈ merge s l r 
goal: x ∈ List.merge s l r