Fixpoint getTreeSupport_dups(A : Set)(t : DistApproxTree A) :=
  match t with
    | dat_leaf o =>
      match o with
        | None => nil
        | Some a => a :: nil
      end
    | dat_internal t1 t2 =>
      getTreeSupport_dups t1 ++ getTreeSupport_dups t2
  end.Definition getTreeSupport(A : Set)(eqd : eq_dec A)(t : DistApproxTree A) : list A :=
  getUnique (getTreeSupport_dups t) eqd.

(* Specifications: *)
Lemma getTreeSupport_in : forall (A : Set)(eqd : eq_dec A)(c : Comp A)(t : DistApproxTree A) n, dat_correct c n t -> forall a, In a (getTreeSupport eqd t) -> In a (getSupport c).
Lemma getTreeSupport_not_in : forall (A : Set)(eqd : eq_dec A)(c : Comp A)(t : DistApproxTree A) n a, dat_correct c n t -> ~In a (getSupport c) -> ~In a (getTreeSupport eqd t).
Lemma dat_exists_h : forall n s (A : Set)(c : Comp A), well_formed_comp c -> exists t : DistApproxTree A, dat_correct_h c s n t.
Theorem dat_exists : forall n (A : Set)(c : Comp A), well_formed_comp c -> exists t : DistApproxTree A, dat_correct c n t.