Require Export MSets.
Require Export GeoCoq.Tactics.Coinc.tactics_axioms.
Module S := MSetList.Make PositiveOrderedTypeBits.
(* We choose to use lists as it is as fast as AVLs for a limited number of points but they are easier to debug. Module S := MSetAVL.Make PositiveOrderedTypeBits. *)
Module SWP := WPropertiesOn PositiveOrderedTypeBits S.
Module SetOfSetsOfPositiveOrderedType <: OrderedType.
Definition t := S.t.
Definition eq := S.Equal.
Include IsEq.
Definition eqb := S.equal.
Definition eqb_eq := S.equal_spec.
Include HasEqBool2Dec.
Definition lt := S.lt.
Instance lt_compat : Proper (eq==>eq==>iff) lt.
Instance lt_strorder : StrictOrder lt.
Definition compare := S.compare.
Definition compare_spec := S.compare_spec.
End SetOfSetsOfPositiveOrderedType.
Module SS := MSetList.Make SetOfSetsOfPositiveOrderedType.
(* Module SS := MSetAVL.Make SetOfSetsOfPositiveOrderedType. *)
Definition fstpp (pair : (positive * positive)) :=
match pair with
|(a,b) => Pos.min a b
end.
Definition sndpp (pair : (positive * positive)) :=
match pair with
|(a,b) => Pos.max a b
end.
Module SetOfPairsOfPositiveOrderedType <: OrderedType.
Definition t:= (positive * positive).
Definition eq (t1 t2 : t) :=
Pos.eq (fstpp(t1)) (fstpp(t2)) /\ Pos.eq (sndpp(t1)) (sndpp(t2)).
Include IsEq.
Definition eqb (t1 t2 : t) :=
Pos.eqb (fstpp(t1)) (fstpp(t2)) && Pos.eqb (sndpp(t1)) (sndpp(t2)).

(* Specifications: *)
Lemma eqb_eq : forall t1 t2, eqb t1 t2 = true <-> eq t1 t2.
Include HasEqBool2Dec.