intuition.
edestruct (dat_exists_repeat2).
eauto.
rewrite repeat_low_tree_approx_same_inv; eauto.
destruct H0.
edestruct dat_exists.
eapply well_formed_Repeat.
eapply comp_eq_dec; eauto.
eauto.
eauto.
eapply leRat_trans.
2:{
eapply eqRat_impl_leRat.
eapply low_tree_approx_same_inv.
eapply H0.
eapply H1.
}
eapply lowDistApprox_dat_better_le.
eapply dat_correct_repeat_same in H0.
eapply dat_better_repeat_sqrt; eauto.
eauto.
econstructor; eauto.
destruct n.
omega.
destruct n.
omega.
simpl.
eapply lt_le_trans.
econstructor.
eapply le_trans.
rewrite <- Nat.sqrt_1.
eauto.
eapply Nat.sqrt_le_mono.
omega.
Grab Existential Variables.
eapply comp_eq_dec; eauto.
Qed.

Lemma datRepeat_better_depth: forall (A : Set) n2 (t2 t1 t1' : DistApproxTree A)(rel : nat -> DistApproxTree A -> Prop) reps depth (P : A -> bool),
forall n1 (t2' : DistApproxTree A),
datRepeat (rel n1) P n2 t2 t2' ->
datRepeat_depth rel P reps depth t1 t1' ->
dat_better t2 t1 ->
n1 >= depth ->
n2 >= reps ->
(forall (n1 n2: nat) (t3 t4 : DistApproxTree A),
rel n1 t3 -> rel n2 t4 -> n1 >= n2 -> dat_better t3 t4) ->
(forall a, rel 0%nat (dat_leaf (Some a)) -> P a = true) ->
(forall n t, rel n t -> datDepth t <= n)%nat ->
dat_better t2' t1'.