Set.finite #
This file handles a simple definition for when a set is considered finite, namely when there exists a list that contains the same elements.
A set is finite if there is a list with the same elements. We also enforce this list to be free of duplicates right now but this might change in the future.
Instances For
theorem CustomBasicDatastructures.Set.finite_of_list_with_same_elements {α : Type u_1} [DecidableEq α] {X : Set α} (l : List α) (same_elements : ∀ (e : α), e ∈ l ↔ e ∈ X) :
X.finite
To show that a Set is finite, it is enough to give a list with the same elements not caring about duplicates. Duplicates are removed using List.eraseDupsKeepRight internally.
theorem CustomBasicDatastructures.Set.finite_of_subset_finite {α : Type u_1} [DecidableEq α] {a b : Set α} (fin : b.finite) :
Subsets of finite sets are finite.
theorem CustomBasicDatastructures.Set.union_finite_of_both_finite {α : Type u_1} [DecidableEq α] {a b : Set α} (fin_a : a.finite) (fin_b : b.finite) :
Unions of finite sets are finite.
theorem CustomBasicDatastructures.Set.map_finite_of_finite {β : Type u_1} {α : Type u_2} [DecidableEq β] {a : Set α} {f : α → β} :
Mapping over a finite set yields a finite set.
Sets obtained from lists are finite.