File: Mathlib/Data/List/Dedup.lean

full_name: List.dedup_nil
code: @[simp]
theorem dedup_nil : dedup [] = ([] : List α) 
goal: [].dedup = []

full_name: List.dedup_cons_of_mem'
code: theorem dedup_cons_of_mem' {a : α} {l : List α} (h : a ∈ dedup l) : dedup (a :: l) = dedup l 
goal: (a :: l).dedup = l.dedup

full_name: List.dedup_cons_of_not_mem'
code: theorem dedup_cons_of_not_mem' {a : α} {l : List α} (h : a ∉ dedup l) :
    dedup (a :: l) = a :: dedup l 
goal: (a :: l).dedup = a :: l.dedup

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

full_name: List.dedup_cons_of_mem
code: @[simp]
theorem dedup_cons_of_mem {a : α} {l : List α} (h : a ∈ l) : dedup (a :: l) = dedup l 
goal: (a :: l).dedup = l.dedup

full_name: List.dedup_cons_of_not_mem
code: @[simp]
theorem dedup_cons_of_not_mem {a : α} {l : List α} (h : a ∉ l) : dedup (a :: l) = a :: dedup l 
goal: (a :: l).dedup = a :: l.dedup

full_name: List.dedup_sublist
code: theorem dedup_sublist : ∀ l : List α, dedup l <+ l 
goal: l.dedup.Sublist l

full_name: List.dedup_subset
code: theorem dedup_subset : ∀ l : List α, dedup l ⊆ l 
goal: l.dedup ⊆ l

full_name: List.subset_dedup
code: theorem subset_dedup (l : List α) : l ⊆ dedup l 
goal: l ⊆ l.dedup

full_name: List.nodup_dedup
code: theorem nodup_dedup : ∀ l : List α, Nodup (dedup l) 
goal: l.dedup.Nodup

full_name: List.headI_dedup
code: theorem headI_dedup [Inhabited α] (l : List α) :
    l.dedup.headI = if l.headI ∈ l.tail then l.tail.dedup.headI else l.headI 
goal: l.dedup.headI = if l.headI ∈ l.tail then l.tail.dedup.headI else l.headI

full_name: List.tail_dedup
code: theorem tail_dedup [Inhabited α] (l : List α) :
    l.dedup.tail = if l.headI ∈ l.tail then l.tail.dedup.tail else l.tail.dedup 
goal: l.dedup.tail = if l.headI ∈ l.tail then l.tail.dedup.tail else l.tail.dedup

full_name: List.dedup_eq_self
code: theorem dedup_eq_self {l : List α} : dedup l = l ↔ Nodup l 
goal: l.dedup = l ↔ l.Nodup

full_name: List.dedup_eq_cons
code: theorem dedup_eq_cons (l : List α) (a : α) (l' : List α) :
    l.dedup = a :: l' ↔ a ∈ l ∧ a ∉ l' ∧ l.dedup.tail = l' 
goal: l.dedup = a :: l' ↔ a ∈ l ∧ a ∉ l' ∧ l.dedup.tail = l'

full_name: List.dedup_eq_nil
code: @[simp]
theorem dedup_eq_nil (l : List α) : l.dedup = [] ↔ l = [] 
goal: l.dedup = [] ↔ l = []

full_name: List.Nodup.dedup
code: protected theorem Nodup.dedup {l : List α} (h : l.Nodup) : l.dedup = l 
goal: l.dedup = l

full_name: List.dedup_idem
code: @[simp]
theorem dedup_idem {l : List α} : dedup (dedup l) = dedup l 
goal: l.dedup.dedup = l.dedup

full_name: List.dedup_append
code: theorem dedup_append (l₁ l₂ : List α) : dedup (l₁ ++ l₂) = l₁ ∪ dedup l₂ 
goal: (l₁ ++ l₂).dedup = l₁ ∪ l₂.dedup

full_name: List.dedup_map_of_injective
code: theorem dedup_map_of_injective [DecidableEq β] {f : α → β} (hf : Function.Injective f)
    (xs : List α) :
    (xs.map f).dedup = xs.dedup.map f 
goal: (List.map f xs).dedup = List.map f xs.dedup

full_name: List.Subset.dedup_append_right
code: /-- Note that the weaker `List.Subset.dedup_append_left` is proved later. -/
theorem Subset.dedup_append_right {xs ys : List α} (h : xs ⊆ ys) :
    dedup (xs ++ ys) = dedup ys 
goal: (xs ++ ys).dedup = ys.dedup

full_name: List.Disjoint.union_eq
code: theorem Disjoint.union_eq {xs ys : List α} (h : Disjoint xs ys) :
    xs ∪ ys = xs.dedup ++ ys 
goal: xs ∪ ys = xs.dedup ++ ys

full_name: List.Disjoint.dedup_append
code: theorem Disjoint.dedup_append {xs ys : List α} (h : Disjoint xs ys) :
    dedup (xs ++ ys) = dedup xs ++ dedup ys 
goal: (xs ++ ys).dedup = xs.dedup ++ ys.dedup

full_name: List.replicate_dedup
code: theorem replicate_dedup {x : α} : ∀ {k}, k ≠ 0 → (replicate k x).dedup = [x]
  
goal: k ≠ 0 → (List.replicate k x).dedup = [x]

full_name: List.count_dedup
code: theorem count_dedup (l : List α) (a : α) : l.dedup.count a = if a ∈ l then 1 else 0 
goal: List.count a l.dedup = if a ∈ l then 1 else 0