Section MapCanon.
Variable A : Type.
Inductive mapcanon : Map A -> Prop :=
| M0_canon : mapcanon (M0 A)
| M1_canon : forall (a:ad) (y:A), mapcanon (M1 A a y)
| M2_canon :
forall m1 m2:Map A,
mapcanon m1 ->
mapcanon m2 -> 2 <= MapCard A (M2 A m1 m2) -> mapcanon (M2 A m1 m2).
Fixpoint MapCanonicalize (m:Map A) : Map A :=
match m with
| M2 m0 m1 => makeM2 A (MapCanonicalize m0) (MapCanonicalize m1)
| _ => m
end.

Lemma MapMerge_canon :
forall m m':Map A, mapcanon m -> mapcanon m' -> mapcanon (MapMerge A m m').