induction t; intuition; simpl in *.
inversion H0; clear H0; subst.
inversion H3; clear H3; subst.
apply evalDet_steps_bind_done_inv in H1.
destruct H1. destruct H0.
intuition.
assert (evalDet_steps (cs_more c1 (ls1 ++ ls2)) (cs_done a (nil ++ ls2))).
eapply evalDet_steps_app_eq.
eauto.
simpl in *.
specialize (evalDet_steps_done_func H1 H0); intuition; subst.
econstructor.
econstructor.
eauto.
econstructor.
intuition.
inversion H0; clear H0; subst.
eapply H3.
econstructor.
eapply evalDet_steps_trans.
eapply evalDet_steps_bind_done.
eapply evalDet_steps_app_eq.
eauto.
simpl.
eauto.
inversion H0; clear H0; subst.
econstructor.
intuition.
inversion H0; clear H0; subst.
eapply H3.
econstructor.
eapply evalDet_steps_trans.
eapply evalDet_steps_bind_done.
eapply evalDet_steps_app_eq.
eauto.
simpl.
eauto.
eapply IHt1.
eauto.
rewrite app_assoc.
eauto.
eapply IHt2.
eauto.
rewrite app_assoc.
eauto.
Qed.

Lemma dat_correct_bind_same_h : forall n (A : Set)(c : Comp A) ls t,
dat_correct_h c ls n t ->
forall (B : Set)(c1 : Comp B)(c2 : B -> Comp A) t1,
c = Bind c1 c2 ->
well_formed_comp c1 ->
(forall a ls', evalDet_steps (cs_more c1 ls) (cs_done a ls') -> ls' = nil) ->
dat_correct_h c1 ls n t1 ->
datMap_depth
(fun (depth : nat) (b : B) t2 => dat_correct_h (c2 b) nil depth t2)
n t1 t.