induction 1; intuition; simpl in *.
eapply H.
trivial.
wftac.
eapply (@IHwell_formed_oc _ (fun x => P (snd x))).
intuition.
wftac.
intuition.
repeat simp_in_support.
simpl in *.
destruct x; simpl in *.
eapply oc_comp_invariant.
intuition.
eapply H3; eauto.
eauto.
eauto.
trivial.
wftac.
wftac.
eapply H1; intuition.
eapply H2; eauto.
eapply H3; eauto.
eapply oc_comp_invariant; intuition.
eapply H3; eauto.
eauto.
eauto.
Qed.

(* Specifications: *)
Theorem oc_comp_spec_eq_until_bad :
forall (A B C : Set)(c : OracleComp A B C),
well_formed_oc c ->
forall (eqdb : EqDec B) (eqdc : EqDec C)(S1 S2 : Set)(o1 : S1 -> A -> Comp (B * S1))(o2 : S2 -> A -> Comp (B * S2)) eqds1 eqds2
(bad1 : S1 -> bool)(bad2 : S2 -> bool)(inv : S1 -> S2 -> Prop),
(forall a b, bad1 a = true -> well_formed_comp (o1 a b)) ->
(forall a b, bad2 a = true -> well_formed_comp (o2 a b)) ->
(forall x1 x2 a,
inv x1 x2 ->
bad1 x1 = bad2 x2 ->
comp_spec
(fun y1 y2 => (bad1 (snd y1) = bad2 (snd y2)) /\ (bad1 (snd y1) = false -> (inv (snd y1) (snd y2) /\ fst y1 = fst y2)))
(o1 x1 a) (o2 x2 a)) ->
(forall a b c d,
bad1 c = true ->
In (a, b) (getSupport (o1 c d)) -> bad1 b = true) ->
(forall a b c d,
bad2 c = true ->
In (a, b) (getSupport (o2 c d)) -> bad2 b = true) ->
((forall s1 s2,
inv s1 s2 ->
bad1 s1 = bad2 s2 ->
comp_spec
(fun y1 y2 => (bad1 (snd y1) = bad2 (snd y2)) /\ (bad1 (snd y1) = false -> inv (snd y1) (snd y2) /\ (fst y1 = fst y2)))
(c _ eqds1 o1 s1)
(c _ eqds2 o2 s2))).