unfold A, le, lt, bool_lt in |- *; simple destruct a; simple destruct b;
auto.
Defined.
End Bool_Order.
(* This module type specifies the domain of values returned by consulting a dictionary ; it is supposed to be an argument of any functor building an implementation for dictionaries *)
Module Type DATA.
Parameter data : Set.
End DATA.
(* A simple implementation of dictionaries : the dictionary IS the (partial) function from keys to values This implementation is clearly inefficient, but since it is trivially correct ; during the building  of a modular program, such trivial correct implementations of module types  may be very useful during the development steps of an application  *)
Module TrivialDict (Key: KEY) (Val: DATA) : DICT with Definition key := Key.A
with Definition data := Val.data.
Definition key := Key.A.
Definition data := Val.data.
Definition dict := key -> option data.
Definition empty (k : key) := None (A:=data).
Definition find (k : key) (d : dict) := d k.
Definition add (k : key) (v : data) (d : dict) : dict :=
fun k' : key =>
match Key.eqdec k' k with
| left _ => Some v
| right _ => d k'
end.

(* Specifications: *)
Theorem empty_def : forall k : key, find k empty = None.
Theorem success :
forall (d : dict) (k : key) (v : data), find k (add k v d) = Some v.
Theorem diff_key :
forall (d : dict) (k k' : key) (v : data),
k <> k' -> find k (add k' v d) = find k d.