Ltac despec := 
  match goal with
    | [H : comp_spec _ _ _  |- _] => destruct H
  end.

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))).