Definition map_fmap (A B:Type) (f:A->B) : map A -> map B :=
  fix map_fmap (m:map A) : map B :=
  match m with
  | Leaf => Leaf _
  | Node m1 o m2 =>
       let x := match o with
                | None => None
                | Some x => Some (f x)
                end in
       Node _ (map_fmap m1) x (map_fmap m2)
  end.

Lemma fmap_eqn2 : forall A B (m:map A) (f:A->B) x b, (map_fmap A B f m)#x = Some b -> exists a, m#x = Some a /\ f a = b.