diff --git a/theories/base.v b/theories/base.v index 522ef57472c481b120ac4633210e16fe115bcff0..c0d5e8982775f09fc99f27ad565c35ff09b1064e 100644 --- a/theories/base.v +++ b/theories/base.v @@ -868,6 +868,13 @@ Notation "X ⊆ Y ⊂ Z" := (X ⊆ Y ∧ Y ⊂ Z) (at level 70, Y at next level) Notation "X ⊂ Y ⊆ Z" := (X ⊂ Y ∧ Y ⊆ Z) (at level 70, Y at next level) : stdpp_scope. Notation "X ⊂ Y ⊂ Z" := (X ⊂ Y ∧ Y ⊂ Z) (at level 70, Y at next level) : stdpp_scope. +Definition option_to_set `{Singleton A C, Empty C} (mx : option A) : C := + match mx with None => ∅ | Some x => {[ x ]} end. +Fixpoint list_to_set `{Singleton A C, Empty C, Union C} (l : list A) : C := + match l with [] => ∅ | x :: l => {[ x ]} ∪ list_to_set l end. +Fixpoint list_to_set_disj `{Singleton A C, Empty C, DisjUnion C} (l : list A) : C := + match l with [] => ∅ | x :: l => {[ x ]} ⊎ list_to_set_disj l end. + (** The class [Lexico A] is used for the lexicographic order on [A]. This order is used to create finite maps, finite sets, etc, and is typically different from the order [(⊆)]. *) diff --git a/theories/sets.v b/theories/sets.v index 5f65c150ea246f88ce7f86843de71e93e7a439ac..0490bca5139f0d0a6c0a3d5563269f1fd469280f 100644 --- a/theories/sets.v +++ b/theories/sets.v @@ -748,13 +748,6 @@ End set. (** * Conversion of option and list *) -Definition option_to_set `{Singleton A C, Empty C} (mx : option A) : C := - match mx with None => ∅ | Some x => {[ x ]} end. -Fixpoint list_to_set `{Singleton A C, Empty C, Union C} (l : list A) : C := - match l with [] => ∅ | x :: l => {[ x ]} ∪ list_to_set l end. -Fixpoint list_to_set_disj `{Singleton A C, Empty C, DisjUnion C} (l : list A) : C := - match l with [] => ∅ | x :: l => {[ x ]} ⊎ list_to_set_disj l end. - Section option_and_list_to_set. Context `{SemiSet A C}. Implicit Types l : list A.