intuition.
eapply comp_spec_consequence.
eapply (fcf_oracle_eq_until_bad (fun x => if (gt_dec (snd x) q) then true else false) (fun x => if (gt_dec (snd x) q) then true else false) eq); intuition; subst.
apply O1_count_wf.
apply Oi_wf.
pairInv.
unfold O1_count, Oi.
destruct (ge_dec b1 q).
fcf_irr_l.
fcf_irr_r.
fcf_simp.
fcf_spec_ret;
simpl in H2;
destruct (gt_dec (S b1) q);
try discriminate;
try omega.
fcf_skip.
fcf_spec_ret; intuition.
apply  O1_count_increases in H0.
simpl in *.
fcf_compute.
apply  Oi_count_increases in H0.
simpl in *.
fcf_compute.
intuition; simpl in *.
fcf_compute.
destruct (gt_dec b1 q); trivial.
destruct (gt_dec (snd (snd b0)) q); intuition; discriminate.
destruct (gt_dec b1 q).
omega.
intuition.
destruct b0.
destruct (gt_dec b1 q).
omega.
intuition.
simpl in *.
subst.
trivial.
Qed.

(* Specifications: *)
Theorem G1_eq_Gi_q :
Pr[G1] == Pr[Gi q].