Theorems · Definition
List.dedup
{α : Type u_1} → [DecidableEq α] → List α → List αdedup l removes duplicates from l (taking only the last occurrence).
Defined as pwFilter (≠).
See also eraseDups which keeps the first occurrence instead:
``
dedup [2, 0, 1, 0, 2, 0] = [1, 2, 0]
eraseDups [2, 0, 1, 0, 2, 0] = [2, 0, 1]
``
- Defined in
- Mathlib.Data.List.Defs
- Cited by
- 47 results in Mathlib
- Foundations
- Depth 14 from the axioms · uses no axioms
- Assumes
- DecidableEq
Around this declaration
Dashed lines are statement dependencies; solid lines are citations in proofs.
Cites0
Mathlib declarations this one mentions in its statement or cites explicitly in its proof. Plumbing is filtered out.
Nothing in Mathlib beyond the foundations.
Cited by50
Results whose statement or proof uses this declaration.
- Multiset.dedupproof · cited by 59
- ArithmeticFunction.cardDistinctFactorsproof · cited by 13
- List.dedup_cons_of_memstatement · cited by 9
- List.dedup_cons_of_notMemstatement · cited by 9
- List.dedup_eq_selfstatement · cited by 8
- List.toFinset_consproof · cited by 8
- List.mem_dedupstatement · cited by 7
- List.nodup_dedupstatement · cited by 5
- List.card_toFinsetstatement · cited by 5
- List.dedup_appendstatement and proof · cited by 3
- List.dedup_cons_of_mem'statement and proof · cited by 3
- List.dedup_cons_of_notMem'statement and proof · cited by 3