Documentation

CslibFrontier.Foundations.Data.List.Dedup

Filtering and removing duplicates #

List.dedup keeps the last copy of each entry. Filtering commutes with it, as lists and not only as sets: the copies that dedup removes are equal to the copy it keeps, so a filter keeps or removes all of them together.

Main results #

theorem List.dedup_filter {α : Type u_1} [DecidableEq α] (p : α → Bool) (l : List α) :

Removing duplicates after filtering is filtering after removing duplicates.