(************************************************************************)
(*         *      The Rocq Prover / The Rocq Development Team           *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
(** * Finite sets library *)
(** This functor derives additional properties from [FSetInterface.S]. Contrary to the functor in [FSetEqProperties] it uses predicates over sets instead of sets operations, i.e. [In x s] instead of [mem x s=true], [Equal s s'] instead of [equal s s'=true], etc. *)
Require Export FSetInterface.
Set Implicit Arguments.
Unset Strict Implicit.
#[global]
Hint Unfold transpose compat_op Proper respectful : fset.
#[global]
Hint Extern 1 (Equivalence _) => constructor; congruence : fset.
(** First, a functor for Weak Sets in functorial version. *)
Module WProperties_fun (Import E : DecidableType)(M : WSfun E).
Module Import Dec := WDecide_fun E M.
Module Import FM := Dec.F (* FSetFacts.WFacts_fun E M *).

(* Specifications: *)
Lemma In_dec : forall x s, {In x s} + {~ In x s}.
Definition Add x s s' := forall y, In y s' <-> E.eq x y \/ In y s.
Lemma Add_Equal : forall x s s', Add x s s' <-> s' [=] add x s.
Ltac expAdd := repeat rewrite Add_Equal.