Fixpoint datDepth (A : Set)(t : DistApproxTree A) : nat :=
  match t with
    | dat_leaf o => O
    | dat_internal t1 t2 =>
      S (max (datDepth t1) (datDepth t2))
  end.

Lemma datCorrect_datDepth : forall (A : Set)(c : Comp A) n t, dat_correct c n t -> (datDepth t <= n)%nat.