induction 1; intuition; subst; simpl in *.
inversion H; clear H; subst. (*evalDet *)
inversion H3; clear H3; subst. (*dat_correct *)
inversion H; clear H; subst. (*evalDet *)
apply evalDet_steps_bind_done_inv in H4.
destruct H4. destruct H. intuition.
econstructor.
econstructor.
specialize (evalDet_steps_done_func H3 H0); intuition; subst.
assert (x0 = nil); eauto; subst.
econstructor.
eauto.
apply evalDet_steps_bind_done_inv in H4.
destruct H4. destruct H0. intuition.
exfalso.
eapply H.
econstructor.
eauto.
apply evalDet_steps_bind_done_inv in H4.
destruct H4. destruct H3. intuition.
exfalso.
eapply H.
econstructor.
eauto.
inversion H3; clear H3; subst.
inversion H0; clear H0; subst.
econstructor.
econstructor.
intuition.
inversion H0; clear H0; subst.
assert (s' = nil); eauto; subst.
eapply H.
econstructor.
eapply evalDet_steps_trans.
eapply evalDet_steps_bind_done.
eauto.
eauto.
econstructor.
inversion H5; clear H5; subst.
inversion H2; clear H2; subst.
assert (s' = nil); eauto; subst.
econstructor.
econstructor.
intuition.
inversion H2; clear H2; subst.
eapply H.
econstructor.
eapply evalDet_steps_trans.
eapply evalDet_steps_bind_done.
eauto.
eauto.
simpl.
eapply dat_correct_h_bind_app; eauto.
eapply dat_correct_h_bind_app; eauto.
econstructor.
eapply IHdat_correct_h1; eauto.
intuition.
eapply evalDet_app_nil; eauto.
edestruct (@evalDet_dec _ c1 s); trivial.
destruct H5.
exfalso.
eauto.
eapply IHdat_correct_h2; eauto.
intuition.
eapply evalDet_app_nil; eauto.
edestruct (@evalDet_dec _ c1 s); trivial.
destruct H5.
exfalso.
eauto.
Qed.

Lemma lowDistApprox_le_bind : forall n (A B : Set)(c1 : Comp B)(c2 : B -> Comp A) a r1 r2,
well_formed_comp c1 ->
(forall b, In b (getSupport c1) -> well_formed_comp (c2 b)) ->
lowDistApprox (Bind c1 c2) a n r1 ->
lowDistApprox_bind c1 c2 a n r2 ->
r1 <= r2.