End NMSig.
Module NMDef : NMSig.
Section NMDef.
Variable A : Type.
Definition nonz x := x != 0.
Definition tp : Type := @UM.base nat_ordType A nonz.
Definition nm_undef := @UM.Undef nat_ordType A nonz.
Definition defined f := @UM.valid nat_ordType A nonz f.
Definition empty := @UM.empty nat_ordType A nonz.
Definition upd k v f := @UM.upd nat_ordType A nonz k v f.
Definition dom f := @UM.dom nat_ordType A nonz f.
Definition dom_eq f1 f2 := @UM.dom_eq nat_ordType A nonz f1 f2.
Definition free k f := @UM.free nat_ordType A nonz k f.
Definition find k f := @UM.find nat_ordType A nonz k f.
Definition union f1 f2 := @UM.union nat_ordType A nonz f1 f2.
Definition nm_filter q f := @UM.um_filter nat_ordType A nonz q f.
Definition empb f := @UM.empb nat_ordType A nonz f.
Definition undefb f := @UM.undefb nat_ordType A nonz f.
Definition pts k v := @UM.pts nat_ordType A nonz k v.
Definition from (f : tp) : @UM.base nat_ordType A nonz := f.
Definition to (b : @UM.base nat_ordType A nonz) : tp := b.

(* Specifications: *)
Lemma ftE b : from (to b) = b. Proof. by []. Qed.
Lemma tfE f : to (from f) = f. Proof. by []. Qed.
Lemma undefE : nm_undef = to (@UM.Undef nat_ordType A nonz). Proof. by []. Qed.
Lemma defE f : defined f = UM.valid (from f). Proof. by []. Qed.
Lemma emptyE : empty = to (@UM.empty nat_ordType A nonz). Proof. by []. Qed.
Lemma updE k v f : upd k v f = to (UM.upd k v (from f)). Proof. by []. Qed.
Lemma domE f : dom f = UM.dom (from f). Proof. by []. Qed.
Lemma dom_eqE f1 f2 : dom_eq f1 f2 = UM.dom_eq (from f1) (from f2).
Section FreshLastKey.