(* définition d'un ordre sur bool et sur le treillis des (Map bool) à domaine fixé*)
Definition leb (b0 b1 : bool) : Prop :=
match b0, b1 with
| false, false => True
| false, true => True
| true, false => False
| true, true => True
end.

(* Specifications: *)
Lemma leb_reflexive : forall b : bool, leb b b.
Lemma leb_antisymmetric : forall b c : bool, leb b c -> leb c b -> b = c.
Lemma leb_transitive : forall a b c : bool, leb a b -> leb b c -> leb a c.
Fixpoint lem (m0 m1 : Map bool) {struct m1} : Prop :=
match m0, m1 with
| M0, M0 => True
| M0, M1 _ _ => False
| M0, M2 _ _ => False
| M1 _ _, M0 => False
| M1 a b, M1 a' b' => if Neqb a a' then leb b b' else False
| M1 _ _, M2 _ _ => False
| M2 _ _, M0 => False
| M2 _ _, M1 _ _ => False
| M2 a b, M2 c d => lem a c /\ lem b d
end.
Lemma lem_reflexive : r_reflexive bool lem.
Lemma lem_antisymmetric : r_antisymmetric bool lem.
Lemma lem_transitive : r_transitive bool lem.
Lemma lem_order : r_order bool lem.
Definition ensemble_base (A : Set) (m : Map A) (x : Map bool) :=
domain_equal A bool m x.