intuition.
destruct (@dat_exists n _ c1).
trivial.
edestruct (@datMap_left_total B A (comp_eq_dec c1) x).
2:{
econstructor.
econstructor.
intuition.
eauto.
eauto.
}
intuition.
destruct (@dat_exists n _ (c2 a)).
eapply H0.
eapply getTreeSupport_in.
eauto.
eauto.
econstructor.
eauto.
Qed.
(* dat_better is an inductive predicate that lets us conclude that one tree will produce an approximation that is at least as good as some other tree. *)
Inductive dat_better(A : Set) : DistApproxTree A -> DistApproxTree A -> Prop :=
| dat_better_leaf_None : forall t,
dat_better t (dat_leaf None)
| dat_better_leaf_Some : forall a,
dat_better (dat_leaf (Some a)) (dat_leaf (Some a))
| dat_better_internal : forall ta1 ta2 tb1 tb2,
dat_better ta1 tb1 ->
dat_better ta2 tb2 ->
dat_better (dat_internal ta1 ta2) (dat_internal tb1 tb2).
Hint Constructors dat_better : dat.

(* Specifications: *)
Lemma dat_better_refl : forall (A : Set)(t : DistApproxTree A),
dat_better t t.