The areas / V33. Data structures and computation
Mathlib.Data.List.Duplicate
26 declarations. Mathlib docs · Source
ctor List.Duplicate.below.cons_duplicate E0 #
∀ {α : Type u_1} {x : α} {motive : (a : List α) → List.Duplicate x a → Prop} {y : α} {l : List α}
(a : List.Duplicate x l), List.Duplicate.below a → motive l a → List.Duplicate.below ⋯
ctor List.Duplicate.below.cons_mem E0 #
∀ {α : Type u_1} {x : α} {motive : (a : List α) → List.Duplicate x a → Prop} {l : List α} (a : x ∈ l),
List.Duplicate.below ⋯
inductive List.Duplicate E1 #
{α : Type u_1} → α → List α → Prop
Property that an element x : α of l : List α can be found in the list more than once.
ctor List.Duplicate.cons_mem E0 #
∀ {α : Type u_1} {x : α} {l : List α}, x ∈ l → List.Duplicate x (x :: l)
ctor List.Duplicate.cons_duplicate E0 #
∀ {α : Type u_1} {x y : α} {l : List α}, List.Duplicate x l → List.Duplicate x (y :: l)
theorem List.Mem.duplicate_cons_self E1 #
∀ {α : Type u_1} {l : List α} {x : α}, x ∈ l → List.Duplicate x (x :: l)
theorem List.Duplicate.duplicate_cons E1 #
∀ {α : Type u_1} {l : List α} {x : α}, List.Duplicate x l → ∀ (y : α), List.Duplicate x (y :: l)
theorem List.Duplicate.mem E1 #
∀ {α : Type u_1} {l : List α} {x : α}, List.Duplicate x l → x ∈ l
theorem List.Duplicate.mem_cons_self E0 #
∀ {α : Type u_1} {l : List α} {x : α}, List.Duplicate x (x :: l) → x ∈ l
theorem List.duplicate_cons_self_iff E0 #
∀ {α : Type u_1} {l : List α} {x : α}, List.Duplicate x (x :: l) ↔ x ∈ l
theorem List.Duplicate.ne_nil E1 #
∀ {α : Type u_1} {l : List α} {x : α}, List.Duplicate x l → l ≠ []
theorem List.not_duplicate_nil E0 #
∀ {α : Type u_1} (x : α), ¬List.Duplicate x []
theorem List.Duplicate.ne_singleton E1 #
∀ {α : Type u_1} {l : List α} {x : α}, List.Duplicate x l → ∀ (y : α), l ≠ [y]
theorem List.not_duplicate_singleton E0 #
∀ {α : Type u_1} (x y : α), ¬List.Duplicate x [y]
theorem List.Duplicate.elim_nil E1 #
∀ {α : Type u_1} {x : α}, List.Duplicate x [] → False
theorem List.Duplicate.elim_singleton E1 #
∀ {α : Type u_1} {x y : α}, List.Duplicate x [y] → False
theorem List.duplicate_cons_iff E0 #
∀ {α : Type u_1} {l : List α} {x y : α}, List.Duplicate x (y :: l) ↔ y = x ∧ x ∈ l ∨ List.Duplicate x l
theorem List.Duplicate.of_duplicate_cons E1 #
∀ {α : Type u_1} {l : List α} {x y : α}, List.Duplicate x (y :: l) → x ≠ y → List.Duplicate x l
theorem List.duplicate_cons_iff_of_ne E1 #
∀ {α : Type u_1} {l : List α} {x y : α}, x ≠ y → (List.Duplicate x (y :: l) ↔ List.Duplicate x l)
theorem List.Duplicate.mono_sublist E1 #
∀ {α : Type u_1} {l : List α} {x : α} {l' : List α}, List.Duplicate x l → l.Sublist l' → List.Duplicate x l'
theorem List.duplicate_iff_sublist E1 #
∀ {α : Type u_1} {l : List α} {x : α}, List.Duplicate x l ↔ [x, x].Sublist l
The contrapositive of List.nodup_iff_sublist.
theorem List.nodup_iff_forall_not_duplicate E1 #
∀ {α : Type u_1} {l : List α}, l.Nodup ↔ ∀ (x : α), ¬List.Duplicate x l
theorem List.exists_duplicate_iff_not_nodup E1 #
∀ {α : Type u_1} {l : List α}, (∃ x, List.Duplicate x l) ↔ ¬l.Nodup
theorem List.Duplicate.not_nodup E1 #
∀ {α : Type u_1} {l : List α} {x : α}, List.Duplicate x l → ¬l.Nodup
theorem List.duplicate_iff_two_le_count E1 #
∀ {α : Type u_1} {l : List α} {x : α} [inst : DecidableEq α], List.Duplicate x l ↔ 2 ≤ List.count x l
instance List.decidableDuplicate E0 #
{α : Type u_1} → [DecidableEq α] → (x : α) → (l : List α) → Decidable (List.Duplicate x l)